memberlist

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVMemberList added in v0.58.0

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

KVMemberList keeps and manages cluster memberlist set.

func NewKVMemberList added in v0.58.0

func NewKVMemberList(localPort int, kv kv.KV, hk *hook.Hooks, logger kitlog.Logger) *KVMemberList

NewKVMemberList will create a new KVMemberList instance using the given configuration.

func (*KVMemberList) GetMember added in v0.58.0

func (ml *KVMemberList) GetMember(instanceID string) (m clustermodel.Member, ok bool)

GetMember returns cluster member info associated to an identifier.

func (*KVMemberList) GetMembers added in v0.58.0

func (ml *KVMemberList) GetMembers() map[string]clustermodel.Member

GetMembers returns all cluster registered members.

func (*KVMemberList) Start added in v0.58.0

func (ml *KVMemberList) Start(ctx context.Context) error

Start is used to join a cluster by registering instance member into the shared KV storage.

func (*KVMemberList) Stop added in v0.58.0

func (ml *KVMemberList) Stop(ctx context.Context) error

Stop unregisters instance member info from the cluster.

type MemberList

type MemberList interface {
	// GetMember returns cluster member info associated to an identifier.
	GetMember(instanceID string) (m clustermodel.Member, ok bool)

	// GetMembers returns all cluster registered members.
	GetMembers() map[string]clustermodel.Member

	// Start initializes memberlist.
	Start(ctx context.Context) error

	// Stop releases all underlying memberlist resources.
	Stop(ctx context.Context) error
}

MemberList defines cluster memberlist interface.

func NewNop added in v0.58.0

func NewNop() MemberList

NewNop returns a memberlist that doesn't do anything.

Jump to

Keyboard shortcuts

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