Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // MessageType return the message type which the handler want to collect MessageType() MessageType // IsHandled checks if the id's message is handled before IsHandled(logger log.Logger, id string) bool // HandleMessage handles the message HandleMessage(logger log.Logger, msg Message) error // Finalize finalizes the result based on the collected messages and return the next handler. // If next handler is nil, it means it's the end of the main process Finalize(logger log.Logger) (Handler, error) }
Handler defines the message handler
type Message ¶
type Message interface { // GetId returns the message id GetId() string // GetMessageType returns the message type GetMessageType() MessageType // IsValid checks if message is valid or not IsValid() bool }
Message defines the message interface
type PeerManager ¶
type PeerManager interface { NumPeers() uint32 SelfID() string MustSend(id string, msg proto.Message) }
PeerManager defines the peer interface
type StateChangedListener ¶
Click to show internal directories.
Click to hide internal directories.