serf

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelDebug = "DEBUG"
	LogLevelWarn  = "WARN"
	LogLevelError = "ERROR"
	LogLevelInfo  = "INFO"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Membership

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

func New

func New(conf *config.Cluster, inboundMsgCh chan<- []byte) *Membership

func (*Membership) BindMqttServer

func (m *Membership) BindMqttServer(server *mqtt.Server)

func (*Membership) Broadcast

func (m *Membership) Broadcast(msg []byte)

func (*Membership) EventChan

func (m *Membership) EventChan() <-chan *mb.Event

func (*Membership) Join added in v2.3.7

func (m *Membership) Join(existing []string) (int, error)

Join joins an existing Serf cluster. Returns the number of nodes successfully contacted. The returned error will be non-nil only in the case that no nodes could be contacted. The format of an existing node is nodename/ip:port or ip:port

func (*Membership) Leave

func (m *Membership) Leave() error

Leave gracefully exits the cluster.

func (*Membership) LocalAddr

func (m *Membership) LocalAddr() string

func (*Membership) LocalName

func (m *Membership) LocalName() string

func (*Membership) Members

func (m *Membership) Members() []mb.Member

func (*Membership) SendToNode

func (m *Membership) SendToNode(nodeName string, msg []byte) error

SendToNode send message to a node

func (*Membership) SendToOthers

func (m *Membership) SendToOthers(msg []byte)

SendToOthers send message to all nodes except yourself

func (*Membership) Setup

func (m *Membership) Setup() (err error)

func (*Membership) Stat

func (m *Membership) Stat() map[string]int64

func (*Membership) Stop

func (m *Membership) Stop()

Jump to

Keyboard shortcuts

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