Versions in this module Expand all Collapse all v1 v1.19.19 Apr 17, 2021 Changes in this version + var ErrClosed = errors.New("already closed") + var ErrInvalidField = errors.New("invalid field type") + type Field struct + type FieldCallback func(n *enode.Node, state Flags, oldValue, newValue interface{}) + type Flags struct + func MergeFlags(list ...Flags) Flags + func (a Flags) And(b Flags) Flags + func (a Flags) AndNot(b Flags) Flags + func (a Flags) Equals(b Flags) bool + func (a Flags) HasAll(b Flags) bool + func (a Flags) HasNone(b Flags) bool + func (a Flags) IsEmpty() bool + func (a Flags) Or(b Flags) Flags + func (a Flags) Xor(b Flags) Flags + func (f Flags) String() string + type NodeStateMachine struct + func NewNodeStateMachine(db ethdb.KeyValueStore, dbKey []byte, clock mclock.Clock, setup *Setup) *NodeStateMachine + func (ns *NodeStateMachine) AddLogMetrics(requireFlags, disableFlags Flags, name string, inMeter, outMeter metrics.Meter, ...) + func (ns *NodeStateMachine) AddTimeout(n *enode.Node, flags Flags, timeout time.Duration) error + func (ns *NodeStateMachine) ForEach(requireFlags, disableFlags Flags, cb func(n *enode.Node, state Flags)) + func (ns *NodeStateMachine) GetField(n *enode.Node, field Field) interface{} + func (ns *NodeStateMachine) GetNode(id enode.ID) *enode.Node + func (ns *NodeStateMachine) GetState(n *enode.Node) Flags + func (ns *NodeStateMachine) Operation(fn func()) error + func (ns *NodeStateMachine) Persist(n *enode.Node) error + func (ns *NodeStateMachine) SetField(n *enode.Node, field Field, value interface{}) error + func (ns *NodeStateMachine) SetFieldSub(n *enode.Node, field Field, value interface{}) error + func (ns *NodeStateMachine) SetState(n *enode.Node, setFlags, resetFlags Flags, timeout time.Duration) error + func (ns *NodeStateMachine) SetStateSub(n *enode.Node, setFlags, resetFlags Flags, timeout time.Duration) + func (ns *NodeStateMachine) Start() + func (ns *NodeStateMachine) Stop() + func (ns *NodeStateMachine) SubscribeField(field Field, callback FieldCallback) + func (ns *NodeStateMachine) SubscribeState(flags Flags, callback StateCallback) + type Setup struct + Version uint + func (s *Setup) NewField(name string, ftype reflect.Type) Field + func (s *Setup) NewFlag(name string) Flags + func (s *Setup) NewPersistentField(name string, ftype reflect.Type, encode func(interface{}) ([]byte, error), ...) Field + func (s *Setup) NewPersistentFlag(name string) Flags + func (s *Setup) OfflineFlag() Flags + type StateCallback func(n *enode.Node, oldState, newState Flags)