raftbadger

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

raft-badger

raft-badger

    raftbadger.NewLogStore(db, []byte("log"))
    raftbadger.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",
}
View Source
var RaftLogType_value = map[string]int32{
	"LogCommand":              0,
	"LogNoop":                 1,
	"LogAddPeerDeprecated":    2,
	"LogRemovePeerDeprecated": 3,
	"LogBarrier":              4,
	"LogConfiguration":        5,
}

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"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*RaftLog) Descriptor

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

func (*RaftLog) GetData

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

func (*RaftLog) GetExtensions

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

func (*RaftLog) GetIndex

func (m *RaftLog) GetIndex() uint64

func (*RaftLog) GetTerm

func (m *RaftLog) GetTerm() uint64

func (*RaftLog) GetType

func (m *RaftLog) GetType() RaftLogType

func (*RaftLog) ProtoMessage

func (*RaftLog) ProtoMessage()

func (*RaftLog) Reset

func (m *RaftLog) Reset()

func (*RaftLog) String

func (m *RaftLog) String() string

func (*RaftLog) XXX_DiscardUnknown

func (m *RaftLog) XXX_DiscardUnknown()

func (*RaftLog) XXX_Marshal

func (m *RaftLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftLog) XXX_Merge

func (m *RaftLog) XXX_Merge(src proto.Message)

func (*RaftLog) XXX_Size

func (m *RaftLog) XXX_Size() int

func (*RaftLog) XXX_Unmarshal

func (m *RaftLog) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

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

func (RaftLogType) String

func (x RaftLogType) String() string

Jump to

Keyboard shortcuts

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