Documentation ¶
Overview ¶
Package cluster is a generated protocol buffer package.
It is generated from these files:
cluster.proto
It has these top-level messages:
Part FullState NodeMeta
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStateKeyAlreadySet = errors.New("specified key is already taken") ErrNodeNotFound = errors.New("specified node not found in mesh") )
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel interface {
Broadcast(b []byte)
}
Channel allows clients to send messages for a specific state type that will be broadcasted in a best-effort manner.
type FullState ¶
type FullState struct {
Parts []*Part `protobuf:"bytes,1,rep,name=parts" json:"parts,omitempty"`
}
func (*FullState) Descriptor ¶
func (*FullState) ProtoMessage ¶
func (*FullState) ProtoMessage()
type Mesh ¶
type Mesh interface { AddState(key string, state State) (Channel, error) Join(hosts []string) error MemberRPCAddress(id string) (string, error) }
Mesh represents the mesh network, being able to broadcast state across the nodes.
func MemberlistMesh ¶
func MemberlistMesh(id identity.Identity, eventHandler memberlist.EventDelegate, meta NodeMeta) Mesh
func MockedMesh ¶
func MockedMesh() Mesh
type NodeMeta ¶
type NodeMeta struct { ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"` RPCAddr string `protobuf:"bytes,2,opt,name=RPCAddr" json:"RPCAddr,omitempty"` }
func (*NodeMeta) Descriptor ¶
func (*NodeMeta) GetRPCAddr ¶
func (*NodeMeta) ProtoMessage ¶
func (*NodeMeta) ProtoMessage()
type Part ¶
type Part struct { Key string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` }
func (*Part) Descriptor ¶
func (*Part) ProtoMessage ¶
func (*Part) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.