hashicorp

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultRaftTimeout is used to apply I/O deadlines. For InstallSnapshot, we multiply
	// DefaultRaftTimeout by (SnapshotSize / TimeoutScale).
	DefaultRaftTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fsm

type Fsm struct {
	*base.KV
	// contains filtered or unexported fields
}

func NewFsm

func NewFsm(notifyCh chan<- *message.Message) *Fsm

func (*Fsm) Apply

func (f *Fsm) Apply(l *raft.Log) interface{}

func (*Fsm) DelByNode

func (f *Fsm) DelByNode(node string) int

func (*Fsm) Lookup added in v2.5.1

func (f *Fsm) Lookup(key string) []string

func (*Fsm) Persist added in v2.5.1

func (f *Fsm) Persist(sink raft.SnapshotSink) error

func (*Fsm) Release added in v2.5.1

func (f *Fsm) Release()

func (*Fsm) Restore

func (f *Fsm) Restore(ir io.ReadCloser) error

func (*Fsm) Snapshot

func (f *Fsm) Snapshot() (raft.FSMSnapshot, error)

type Peer

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

func Setup

func Setup(conf *config.Cluster, notifyCh chan<- *message.Message) (*Peer, error)

func (*Peer) DelByNode

func (p *Peer) DelByNode(node string) int

func (*Peer) GenPeersFile

func (p *Peer) GenPeersFile(file string) error

func (*Peer) GetLeader

func (p *Peer) GetLeader() (addr, id string)

func (*Peer) IsApplyRight

func (p *Peer) IsApplyRight() bool

func (*Peer) Join

func (p *Peer) Join(nodeId, addr string) error

func (*Peer) Leave

func (p *Peer) Leave(nodeId string) error

func (*Peer) Lookup

func (p *Peer) Lookup(key string) []string

func (*Peer) Propose

func (p *Peer) Propose(msg *message.Message) error

func (*Peer) Status

func (p *Peer) Status() ([]byte, error)

func (*Peer) Stop

func (p *Peer) Stop()

Jump to

Keyboard shortcuts

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