types

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	Broadcast(b []byte)
	BroadcastFullState(b []byte)
}

Channel allows clients to send messages for a specific state type that will be broadcasted in a best-effort manner.

type GossipServiceLayer

type GossipServiceLayer interface {
	ServiceLayer
	Leave()
	Members() []*memberlist.Node
	UpdateMeta([]byte)
	Join([]string) error
	AddState(key string, state GossipState) (Channel, error)
}

type GossipState

type GossipState interface {
	Merge(inc []byte, full bool) error
	MarshalBinary() []byte
}

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

type RaftServiceLayer

type RaftServiceLayer interface {
	ServiceLayer
	Start(name string, state RaftState) error
	ApplyEvent(event []byte) error
	Shutdown() error
	IsLeader() bool
}

type RaftState

type RaftState interface {
	Apply(event []byte) error
	Snapshot() io.ReadCloser
	Restore(io.Reader) error
}

type ServiceLayer

type ServiceLayer interface {
	pb.LayerServer
	Health() string
}

Jump to

Keyboard shortcuts

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