Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPC ¶
type RPC interface { // All will send a given data object to all other RPC instances on the fleet // and will collect responses All(ctx context.Context, data []byte) ([]any, error) // Broadcast will do the same as All but will not wait for responses Broadcast(ctx context.Context, data []byte) error // Request will send a given object to a specific peer and return the response Request(ctx context.Context, id string, data []byte) ([]byte, error) // Send will send a given buffer to a specific peer and ignore the response Send(ctx context.Context, id string, data []byte) error // Self will return the id of the local peer, can be used for other instances // to contact here with Send(). Self() string // ListPeers returns a list of connected peers ListOnlinePeers() []string // CountAllPeers return the number of known connected or offline peers CountAllPeers() int // Connect connects this RPC instance incoming events to a given function // that will be called each time an event is received. Connect(cb func(context.Context, []byte) ([]byte, error)) }
RPC interface is standardized
func NewLogPeer ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.