memlistconf

package
v0.0.0-...-59b76e6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	State KeyName = "state"

	Idle       StateName = "idle"
	Joining    StateName = "joining"
	Assembling StateName = "assembling"

	Join      EventName = "join"
	Joined    EventName = "joined"
	Assemble  EventName = "assemble"
	Assembled EventName = "assembled"
	Finish    EventName = "finish"
)

Variables

This section is empty.

Functions

Types

type Broadcast

type Broadcast struct {
	memberlist.NamedBroadcast
	// contains filtered or unexported fields
}

func NewBroadcast

func NewBroadcast(logger *zap.Logger, ml *memberlist.Memberlist, name string, msg []byte, notifyCh chan<- struct{}) *Broadcast

func (*Broadcast) Finished

func (b *Broadcast) Finished()

func (*Broadcast) Invalidates

func (b *Broadcast) Invalidates(other memberlist.Broadcast) bool

func (*Broadcast) Message

func (b *Broadcast) Message() []byte

func (*Broadcast) Name

func (b *Broadcast) Name() string

type Delegate

type Delegate struct {
	// contains filtered or unexported fields
}

func (*Delegate) GetBroadcasts

func (d *Delegate) GetBroadcasts(overhead, limit int) [][]byte

func (*Delegate) LocalState

func (d *Delegate) LocalState(join bool) []byte

func (*Delegate) MergeRemoteState

func (d *Delegate) MergeRemoteState(buf []byte, join bool)

func (*Delegate) NodeMeta

func (d *Delegate) NodeMeta(limit int) []byte

func (*Delegate) NotifyMsg

func (d *Delegate) NotifyMsg(b []byte)

type EventName

type EventName = string

type GlobalState

type GlobalState struct {
	// contains filtered or unexported fields
}

func NewState

func NewState(logger *zap.Logger, node *memberlist.Node) *GlobalState

func (*GlobalState) Event

func (s *GlobalState) Event(name EventName, args ...interface{}) error

func (*GlobalState) LocalNode

func (s *GlobalState) LocalNode() NodeData

func (*GlobalState) LocalState

func (s *GlobalState) LocalState() Nodes

func (*GlobalState) LogFullState

func (s *GlobalState) LogFullState()

func (*GlobalState) Merge

func (s *GlobalState) Merge(key string, data NodeData)

func (*GlobalState) Name

func (s *GlobalState) Name() string

func (*GlobalState) Size

func (s *GlobalState) Size() int

type KeyName

type KeyName = string

type Message

type Message struct {
	Topic string
	Data  map[string]string
}

type Messenger

type Messenger struct {
	// contains filtered or unexported fields
}

func (*Messenger) Broadcast

func (m *Messenger) Broadcast(topic string, data []byte)

type NodeData

type NodeData = map[string]interface{}

type Nodes

type Nodes = map[string]NodeData

type StateName

type StateName = string

Jump to

Keyboard shortcuts

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