memberlist

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemberList

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

MemberList keeps and manages cluster memberlist set.

func New

func New(kv kv.KV, localPort int, hk *hook.Hooks) *MemberList

New will create a new MemberList instance using the given configuration.

func (*MemberList) GetMember

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

GetMember returns cluster member info associated to an identifier.

func (*MemberList) GetMembers

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

GetMembers returns all cluster registered members.

func (*MemberList) Start

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

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

func (*MemberList) Stop

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

Stop unregisters instance member info from the cluster.

Jump to

Keyboard shortcuts

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