membership

package
v0.0.0-...-3a74bb8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NodeId   string
	SerfAddr string
	Logger   logging.Logger
	RpcAddr  string
}

type Member

type Member struct {
	// Global unique identifier for the node
	NodeId   string `json:"nodeId"`
	RpcAddr  string `json:"addr"`
	SerfAddr string `json:"serfAddr"`
	State    string `json:"state"`
}

func (*Member) Marshal

func (m *Member) Marshal() (map[string]string, error)

func (*Member) Unmarshal

func (t *Member) Unmarshal(m map[string]string) error

type Membership

type Membership interface {
	Join(addrs ...string) (int, error)
	Leave() error
	Members() ([]Member, error)
	SerfAddr() string
	SubscribeJoinEvents() <-chan Member

	SubscribeLeaveEvents() <-chan Member

	NodeId() string
}

func New

func New(config Config) (Membership, error)

Jump to

Keyboard shortcuts

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