Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownSignBytes = errors.New("valsigner: unknown sign bytes") ErrRuleDropped = errors.New("valsigner: signature dropped by control rule") )
Functions ¶
This section is empty.
Types ¶
type ControllableSigner ¶
type ControllableSigner struct {
// contains filtered or unexported fields
}
func NewControllableSigner ¶
func NewControllableSigner(signer types.Signer, controller *Controller, logger *slog.Logger) *ControllableSigner
func (*ControllableSigner) Close ¶
func (c *ControllableSigner) Close() error
func (*ControllableSigner) PubKey ¶
func (c *ControllableSigner) PubKey() crypto.PubKey
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) ClearRule ¶
func (c *Controller) ClearRule(phase Phase)
func (*Controller) Evaluate ¶
func (c *Controller) Evaluate(target SignedTarget) (Rule, bool)
func (*Controller) Reset ¶
func (c *Controller) Reset()
func (*Controller) SetRule ¶
func (c *Controller) SetRule(phase Phase, rule Rule)
func (*Controller) Snapshot ¶
func (c *Controller) Snapshot() (map[Phase]*RuleView, map[Phase]PhaseStats)
type PhaseStats ¶
type Rule ¶
type Rule struct {
Action Action `json:"action"`
Height *int64 `json:"height,omitempty"`
Round *int `json:"round,omitempty"`
Delay time.Duration `json:"-"`
}
func ParseRuleRequest ¶
func (Rule) Matches ¶
func (r Rule) Matches(target SignedTarget) bool
type SignedTarget ¶
func ClassifySignBytes ¶
func ClassifySignBytes(signBytes []byte) (SignedTarget, error)
Click to show internal directories.
Click to hide internal directories.