Versions in this module Expand all Collapse all v3 v3.0.1 Dec 27, 2023 Changes in this version type Message + Start func() error + Stop func() error v3.0.0 Dec 23, 2022 Changes in this version + var ErrorBroadcasterExist = errors.New("broadcaster exist") + var ErrorDecoderExist = errors.New("decoder exist") + var ErrorInterceptorExist = errors.New("interceptor exist") + var ErrorInvalidParameter = errors.New("invalid parameter") + var ErrorNotRunning = errors.New("not running") + var ErrorRemoterEqualLocal = errors.New("remoter equal local") + var ErrorRemoterExist = errors.New("remoter exist") + var ErrorRemoterNotExist = errors.New("remoter not exist") + var ErrorRunRepeatedly = errors.New("run repeatedly") + type Broadcast func(Node, Node) (interface{}, error) + type ConsistentEngine interface + AddBroadcaster func(id string, broadcast StatusBroadcaster) error + PutRemoter func(id string, node Node) error + RegisterStatusCoder func(decoderType int8, decoder Decoder) error + RegisterStatusInterceptor func(interceptorType int8, interceptor StatusInterceptor) error + RemoveRemoter func(id string) error + Start func(ctx context.Context) error + Stop func(ctx context.Context) error + UpdateNodeStatus func(id string, node Node) error + type Decoder interface + Decode func(interface{}) interface{} + MsgType func() int8 + type Logger interface + Debug func(args ...interface{}) + Debugf func(format string, args ...interface{}) + Debugw func(msg string, keysAndValues ...interface{}) + Error func(args ...interface{}) + Errorf func(format string, args ...interface{}) + Errorw func(msg string, keysAndValues ...interface{}) + Info func(args ...interface{}) + Infof func(format string, args ...interface{}) + Infow func(msg string, keysAndValues ...interface{}) + Warn func(args ...interface{}) + Warnf func(format string, args ...interface{}) + Warnw func(msg string, keysAndValues ...interface{}) + type Message interface + Receive func() interface{} + Send func(payload interface{}) + type Node interface + ID func() string + Statuses func() map[int8]Status + UpdateStatus func(status Status) + type Status interface + Data func() interface{} + Type func() int8 + Update func(status Status) + type StatusBroadcaster interface + ID func() string + IsRunning func() bool + PreBroadcaster func() Broadcast + Start func() error + Stop func() error + TimePattern func() interface{} + type StatusConsistentEngine struct + func NewConsistentService(local Node, msg Message, log Logger) *StatusConsistentEngine + func (e *StatusConsistentEngine) AddBroadcaster(id string, broadcaster StatusBroadcaster) error + func (e *StatusConsistentEngine) PutRemoter(id string, node Node) error + func (e *StatusConsistentEngine) RegisterStatusCoder(decoderType int8, decoder Decoder) error + func (e *StatusConsistentEngine) RegisterStatusInterceptor(interceptorType int8, interceptor StatusInterceptor) error + func (e *StatusConsistentEngine) RemoveRemoter(id string) error + func (e *StatusConsistentEngine) Start(ctx context.Context) error + func (e *StatusConsistentEngine) Stop(ctx context.Context) error + func (e *StatusConsistentEngine) UpdateNodeStatus(id string, node Node) error + type StatusInterceptor interface + Handle func(status Status) error Other modules containing this package chainmaker.org/chainmaker/consensus-utils/v2