raft_badger

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

raft-badger

raft-badger

    raft_badger.NewLogStore(db, []byte("log"))
    raft_badger.NewStableStore(db, []byte("conf"))

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RaftLogType_name = map[int32]string{
		0: "LogCommand",
		1: "LogNoop",
		2: "LogAddPeerDeprecated",
		3: "LogRemovePeerDeprecated",
		4: "LogBarrier",
		5: "LogConfiguration",
	}
	RaftLogType_value = map[string]int32{
		"LogCommand":              0,
		"LogNoop":                 1,
		"LogAddPeerDeprecated":    2,
		"LogRemovePeerDeprecated": 3,
		"LogBarrier":              4,
		"LogConfiguration":        5,
	}
)

Enum value maps for RaftLogType.

View Source
var File_raft_badger_proto protoreflect.FileDescriptor

Functions

func NewLogStore

func NewLogStore(db *badger.DB, prefix []byte) raft.LogStore

func NewStableStore

func NewStableStore(db *badger.DB, prefix []byte) raft.StableStore

Types

type RaftLog

type RaftLog struct {
	Index      uint64      `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Term       uint64      `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
	Type       RaftLogType `protobuf:"varint,3,opt,name=type,proto3,enum=raftbadger.RaftLogType" json:"type,omitempty"`
	Data       []byte      `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	Extensions []byte      `protobuf:"bytes,5,opt,name=extensions,proto3" json:"extensions,omitempty"`
	// contains filtered or unexported fields
}

func (*RaftLog) Descriptor deprecated

func (*RaftLog) Descriptor() ([]byte, []int)

Deprecated: Use RaftLog.ProtoReflect.Descriptor instead.

func (*RaftLog) GetData

func (x *RaftLog) GetData() []byte

func (*RaftLog) GetExtensions

func (x *RaftLog) GetExtensions() []byte

func (*RaftLog) GetIndex

func (x *RaftLog) GetIndex() uint64

func (*RaftLog) GetTerm

func (x *RaftLog) GetTerm() uint64

func (*RaftLog) GetType

func (x *RaftLog) GetType() RaftLogType

func (*RaftLog) ProtoMessage

func (*RaftLog) ProtoMessage()

func (*RaftLog) ProtoReflect

func (x *RaftLog) ProtoReflect() protoreflect.Message

func (*RaftLog) Reset

func (x *RaftLog) Reset()

func (*RaftLog) String

func (x *RaftLog) String() string

type RaftLogType

type RaftLogType int32
const (
	RaftLogType_LogCommand              RaftLogType = 0
	RaftLogType_LogNoop                 RaftLogType = 1
	RaftLogType_LogAddPeerDeprecated    RaftLogType = 2
	RaftLogType_LogRemovePeerDeprecated RaftLogType = 3
	RaftLogType_LogBarrier              RaftLogType = 4
	RaftLogType_LogConfiguration        RaftLogType = 5
)

func (RaftLogType) Descriptor

func (RaftLogType) Enum

func (x RaftLogType) Enum() *RaftLogType

func (RaftLogType) EnumDescriptor deprecated

func (RaftLogType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RaftLogType.Descriptor instead.

func (RaftLogType) Number

func (x RaftLogType) Number() protoreflect.EnumNumber

func (RaftLogType) String

func (x RaftLogType) String() string

func (RaftLogType) Type

Jump to

Keyboard shortcuts

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