Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServer(s *grpc.Server)
- type BoltStorage
- func (b *BoltStorage) Append(entries []pb.Entry) error
- func (b *BoltStorage) ApplySnapshot(snap pb.Snapshot) error
- func (b *BoltStorage) Compact(cIndex uint64) error
- func (b *BoltStorage) CreateSnapshot(i uint64, cs *pb.ConfState, data []byte) (pb.Snapshot, error)
- func (b *BoltStorage) Entries(lo, hi uint64) ([]pb.Entry, error)
- func (b *BoltStorage) FirstIndex() (uint64, error)
- func (b *BoltStorage) GetNodeId() uint64
- func (b *BoltStorage) InitialState() (pb.HardState, pb.ConfState, error)
- func (b *BoltStorage) LastIndex() (uint64, error)
- func (b *BoltStorage) SetHardState(st pb.HardState) error
- func (b *BoltStorage) SetNodeId(id uint64) error
- func (b *BoltStorage) Snapshot() (pb.Snapshot, error)
- func (b *BoltStorage) Term(i uint64) (uint64, error)
- type Hub
- type Node
- type RaftSender
- type Task
- type TaskRunner
Constants ¶
View Source
const (
STORAGE_RAFT_BUCKET = "conf-raft"
)
Variables ¶
View Source
var ErrCompacted = errors.New("requested index is unavailable due to compaction")
View Source
var ErrSnapOutOfDate = errors.New("requested index is older than the existing snapshot")
Functions ¶
func RegisterServer ¶
Types ¶
type BoltStorage ¶
type BoltStorage struct {
// contains filtered or unexported fields
}
func CreateBoltStorage ¶
func CreateBoltStorage(fileName string) (*BoltStorage, error)
func (*BoltStorage) ApplySnapshot ¶
func (b *BoltStorage) ApplySnapshot(snap pb.Snapshot) error
func (*BoltStorage) Compact ¶
func (b *BoltStorage) Compact(cIndex uint64) error
func (*BoltStorage) CreateSnapshot ¶
func (*BoltStorage) FirstIndex ¶
func (b *BoltStorage) FirstIndex() (uint64, error)
func (*BoltStorage) GetNodeId ¶
func (b *BoltStorage) GetNodeId() uint64
func (*BoltStorage) InitialState ¶
func (*BoltStorage) LastIndex ¶
func (b *BoltStorage) LastIndex() (uint64, error)
func (*BoltStorage) SetHardState ¶
func (b *BoltStorage) SetHardState(st pb.HardState) error
func (*BoltStorage) SetNodeId ¶
func (b *BoltStorage) SetNodeId(id uint64) error
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) AddServerStream ¶
func (h *Hub) AddServerStream(id uint64, ss pb.Coordinate_EmitRaftStepServer)
func (*Hub) SendMessage ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) GetMessageChan ¶
type RaftSender ¶
type TaskRunner ¶
type TaskRunner struct {
// contains filtered or unexported fields
}
func NewTaskRunner ¶
func NewTaskRunner() *TaskRunner
Click to show internal directories.
Click to hide internal directories.