Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ASC declares ascending sort order ASC = iota // DESC declares descending sort order DESC )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection interface {
AddNode(node *rpc.Node)
DeleteNode(address string)
GetKeys() []string
GetNodes() []*rpc.Node
GetNodeByAddress(address string) (*rpc.Node, bool)
GetRandomNode() (*rpc.Node, error)
GetRandomNodes(size int) []*rpc.Node
GetSampleSize(zscore float64, moe float64) int
GetSortedNodes(o SortOrder) []*rpc.Node
Len() int
}
Collection is an unordered grouping of Nodes
type Config ¶
type Config struct {
Address string
BroadcastAddress string
Seed *rpc.Node
RPCPort uint32
UDPPort uint32
}
Config ...
type Server ¶
type Server interface {
StartListener(address string, port int) error
Stop()
Join(ctx context.Context, in *rpc.JoinMessageInput) (*rpc.JoinMessageOutput, error)
Leave(ctx context.Context, in *rpc.LeaveMessageInput) (*rpc.LeaveMessageOutput, error)
Ping(ctx context.Context, in *rpc.PingMessageInput) (*rpc.PingMessageOutput, error)
PingRequest(ctx context.Context, in *rpc.PingRequestMessageInput) (*rpc.PingMessageOutput, error)
}
Server ...
Click to show internal directories.
Click to hide internal directories.