raftconclave

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MPL-2.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 CfgMember

type CfgMember struct {
	NodeID           string `yaml:"node_id"`
	RaftAddress      string `yaml:"raft_address"`
	DiscoveryAddress string `yaml:"discovery_address"`
}

type CfgPersistence

type CfgPersistence struct {
	Folder string `yaml:"folder"`
}

type Configuration

type Configuration struct {
	Persistence CfgPersistence `yaml:"persistence"`
	Members     []CfgMember    `yaml:"members"`
	NodeID      string         `yaml:"node_id"`
}

type RaftConclave

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

func NewRaftConclave

func NewRaftConclave(logger *log.Entry, ctx context.Context, wg *sync.WaitGroup, config *Configuration) (raftConclave *RaftConclave, err error)

func (*RaftConclave) IsLeader

func (raftConclave *RaftConclave) IsLeader() (isLeader bool)

func (*RaftConclave) Raft

func (raftConclave *RaftConclave) Raft() (raftRaft *raft.Raft)

func (*RaftConclave) Run

func (raftConclave *RaftConclave) Run() (err error)

type RaftFSM

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

func (*RaftFSM) Apply

func (rf *RaftFSM) Apply(raftLog *raft.Log) any

func (*RaftFSM) Restore

func (rf *RaftFSM) Restore(rc io.ReadCloser) error

func (*RaftFSM) Snapshot

func (rf *RaftFSM) Snapshot() (raft.FSMSnapshot, error)

Jump to

Keyboard shortcuts

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