membership

package
v0.0.0-...-e2172d6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 13 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 interface {
	Context() context.Context
	StreamTimeout() time.Duration
	DrainTimeout() time.Duration
	Reporter() Reporter
	Logger() raftlog.Logger
	Dial() transport.Dial
	AllowPipelining() bool
}

Config define common configuration used by the pool.

type Member

type Member interface {
	ID() uint64
	Address() string
	ActiveSince() time.Time
	IsActive() bool
	Update(m raftpb.Member) error
	Send(etcdraftpb.Message) error
	Type() raftpb.MemberType
	Raw() raftpb.Member
	Close() error
	TearDown(ctx context.Context) error
}

Member represents a raft cluster member.

type Pool

type Pool interface {
	NextID() uint64
	Members() []Member
	Get(uint64) (Member, bool)
	Add(raftpb.Member) error
	Update(raftpb.Member) error
	Remove(raftpb.Member) error
	Snapshot() []raftpb.Member
	Restore([]raftpb.Member)
	RegisterTypeMatcher(func(raftpb.Member) raftpb.MemberType)
	TearDown(context.Context) error
}

Pool represents a set of raft Members.

func New

func New(cfg Config) Pool

New construct and returns a new pool members.

type Reporter

type Reporter interface {
	ReportUnreachable(id uint64)
	ReportShutdown(id uint64)
	ReportSnapshot(id uint64, status raft.SnapshotStatus)
}

Reporter is used to report on a member status.

Jump to

Keyboard shortcuts

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