cluster

package
v0.0.39-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

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) Descriptor() ([]byte, []int)

func (*FullState) GetParts

func (m *FullState) GetParts() []*Part

func (*FullState) ProtoMessage

func (*FullState) ProtoMessage()

func (*FullState) Reset

func (m *FullState) Reset()

func (*FullState) String

func (m *FullState) String() string

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) Descriptor() ([]byte, []int)

func (*NodeMeta) GetID

func (m *NodeMeta) GetID() string

func (*NodeMeta) GetRPCAddr

func (m *NodeMeta) GetRPCAddr() string

func (*NodeMeta) ProtoMessage

func (*NodeMeta) ProtoMessage()

func (*NodeMeta) Reset

func (m *NodeMeta) Reset()

func (*NodeMeta) String

func (m *NodeMeta) String() string

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) Descriptor() ([]byte, []int)

func (*Part) GetData

func (m *Part) GetData() []byte

func (*Part) GetKey

func (m *Part) GetKey() string

func (*Part) ProtoMessage

func (*Part) ProtoMessage()

func (*Part) Reset

func (m *Part) Reset()

func (*Part) String

func (m *Part) String() string

type State

type State interface {
	Merge(inc []byte) error
	MarshalBinary() []byte
}

State represents a CRDT state store, that will be distributed over the mesh network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL