eraftpb

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package eraftpb is a generated protocol buffer package.

It is generated from these files:

eraftpb.proto

It has these top-level messages:

Entry
SnapshotMetadata
Snapshot
Message
HardState
ConfState
ConfChange

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEraftpb = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEraftpb   = fmt.Errorf("proto: integer overflow")
)
View Source
var ConfChangeType_name = map[int32]string{
	0: "AddNode",
	1: "RemoveNode",
}
View Source
var ConfChangeType_value = map[string]int32{
	"AddNode":    0,
	"RemoveNode": 1,
}
View Source
var EntryType_name = map[int32]string{
	0: "EntryNormal",
	1: "EntryConfChange",
}
View Source
var EntryType_value = map[string]int32{
	"EntryNormal":     0,
	"EntryConfChange": 1,
}
View Source
var MessageType_name = map[int32]string{
	0:  "MsgHup",
	1:  "MsgBeat",
	2:  "MsgPropose",
	3:  "MsgAppend",
	4:  "MsgAppendResponse",
	5:  "MsgRequestVote",
	6:  "MsgRequestVoteResponse",
	7:  "MsgSnapshot",
	8:  "MsgHeartbeat",
	9:  "MsgHeartbeatResponse",
	10: "MsgUnreachable",
	11: "MsgSnapStatus",
	12: "MsgCheckQuorum",
	13: "MsgTransferLeader",
	14: "MsgTimeoutNow",
	15: "MsgReadIndex",
	16: "MsgReadIndexResp",
	17: "MsgRequestPreVote",
	18: "MsgRequestPreVoteResponse",
}
View Source
var MessageType_value = map[string]int32{
	"MsgHup":                    0,
	"MsgBeat":                   1,
	"MsgPropose":                2,
	"MsgAppend":                 3,
	"MsgAppendResponse":         4,
	"MsgRequestVote":            5,
	"MsgRequestVoteResponse":    6,
	"MsgSnapshot":               7,
	"MsgHeartbeat":              8,
	"MsgHeartbeatResponse":      9,
	"MsgUnreachable":            10,
	"MsgSnapStatus":             11,
	"MsgCheckQuorum":            12,
	"MsgTransferLeader":         13,
	"MsgTimeoutNow":             14,
	"MsgReadIndex":              15,
	"MsgReadIndexResp":          16,
	"MsgRequestPreVote":         17,
	"MsgRequestPreVoteResponse": 18,
}

Functions

This section is empty.

Types

type ConfChange

type ConfChange struct {
	Id               *uint64         `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	ChangeType       *ConfChangeType `protobuf:"varint,2,opt,name=change_type,json=changeType,enum=eraftpb.ConfChangeType" json:"change_type,omitempty"`
	NodeId           *uint64         `protobuf:"varint,3,opt,name=node_id,json=nodeId" json:"node_id,omitempty"`
	Context          []byte          `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"`
	XXX_unrecognized []byte          `json:"-"`
}

func (*ConfChange) Descriptor

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

func (*ConfChange) GetChangeType

func (m *ConfChange) GetChangeType() ConfChangeType

func (*ConfChange) GetContext

func (m *ConfChange) GetContext() []byte

func (*ConfChange) GetId

func (m *ConfChange) GetId() uint64

func (*ConfChange) GetNodeId

func (m *ConfChange) GetNodeId() uint64

func (*ConfChange) Marshal

func (m *ConfChange) Marshal() (dAtA []byte, err error)

func (*ConfChange) MarshalTo

func (m *ConfChange) MarshalTo(dAtA []byte) (int, error)

func (*ConfChange) ProtoMessage

func (*ConfChange) ProtoMessage()

func (*ConfChange) Reset

func (m *ConfChange) Reset()

func (*ConfChange) Size

func (m *ConfChange) Size() (n int)

func (*ConfChange) String

func (m *ConfChange) String() string

func (*ConfChange) Unmarshal

func (m *ConfChange) Unmarshal(dAtA []byte) error

type ConfChangeType

type ConfChangeType int32
const (
	ConfChangeType_AddNode    ConfChangeType = 0
	ConfChangeType_RemoveNode ConfChangeType = 1
)

func (ConfChangeType) Enum

func (x ConfChangeType) Enum() *ConfChangeType

func (ConfChangeType) EnumDescriptor

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

func (ConfChangeType) String

func (x ConfChangeType) String() string

func (*ConfChangeType) UnmarshalJSON

func (x *ConfChangeType) UnmarshalJSON(data []byte) error

type ConfState

type ConfState struct {
	Nodes            []uint64 `protobuf:"varint,1,rep,name=nodes" json:"nodes,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*ConfState) Descriptor

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

func (*ConfState) GetNodes

func (m *ConfState) GetNodes() []uint64

func (*ConfState) Marshal

func (m *ConfState) Marshal() (dAtA []byte, err error)

func (*ConfState) MarshalTo

func (m *ConfState) MarshalTo(dAtA []byte) (int, error)

func (*ConfState) ProtoMessage

func (*ConfState) ProtoMessage()

func (*ConfState) Reset

func (m *ConfState) Reset()

func (*ConfState) Size

func (m *ConfState) Size() (n int)

func (*ConfState) String

func (m *ConfState) String() string

func (*ConfState) Unmarshal

func (m *ConfState) Unmarshal(dAtA []byte) error

type Entry

type Entry struct {
	EntryType        *EntryType `protobuf:"varint,1,opt,name=entry_type,json=entryType,enum=eraftpb.EntryType" json:"entry_type,omitempty"`
	Term             *uint64    `protobuf:"varint,2,opt,name=term" json:"term,omitempty"`
	Index            *uint64    `protobuf:"varint,3,opt,name=index" json:"index,omitempty"`
	Data             []byte     `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"`
	SyncLog          *bool      `protobuf:"varint,5,opt,name=sync_log,json=syncLog" json:"sync_log,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (*Entry) Descriptor

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

func (*Entry) GetData

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

func (*Entry) GetEntryType

func (m *Entry) GetEntryType() EntryType

func (*Entry) GetIndex

func (m *Entry) GetIndex() uint64

func (*Entry) GetSyncLog

func (m *Entry) GetSyncLog() bool

func (*Entry) GetTerm

func (m *Entry) GetTerm() uint64

func (*Entry) Marshal

func (m *Entry) Marshal() (dAtA []byte, err error)

func (*Entry) MarshalTo

func (m *Entry) MarshalTo(dAtA []byte) (int, error)

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) Size

func (m *Entry) Size() (n int)

func (*Entry) String

func (m *Entry) String() string

func (*Entry) Unmarshal

func (m *Entry) Unmarshal(dAtA []byte) error

type EntryType

type EntryType int32
const (
	EntryType_EntryNormal     EntryType = 0
	EntryType_EntryConfChange EntryType = 1
)

func (EntryType) Enum

func (x EntryType) Enum() *EntryType

func (EntryType) EnumDescriptor

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

func (EntryType) String

func (x EntryType) String() string

func (*EntryType) UnmarshalJSON

func (x *EntryType) UnmarshalJSON(data []byte) error

type HardState

type HardState struct {
	Term             *uint64 `protobuf:"varint,1,opt,name=term" json:"term,omitempty"`
	Vote             *uint64 `protobuf:"varint,2,opt,name=vote" json:"vote,omitempty"`
	Commit           *uint64 `protobuf:"varint,3,opt,name=commit" json:"commit,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*HardState) Descriptor

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

func (*HardState) GetCommit

func (m *HardState) GetCommit() uint64

func (*HardState) GetTerm

func (m *HardState) GetTerm() uint64

func (*HardState) GetVote

func (m *HardState) GetVote() uint64

func (*HardState) Marshal

func (m *HardState) Marshal() (dAtA []byte, err error)

func (*HardState) MarshalTo

func (m *HardState) MarshalTo(dAtA []byte) (int, error)

func (*HardState) ProtoMessage

func (*HardState) ProtoMessage()

func (*HardState) Reset

func (m *HardState) Reset()

func (*HardState) Size

func (m *HardState) Size() (n int)

func (*HardState) String

func (m *HardState) String() string

func (*HardState) Unmarshal

func (m *HardState) Unmarshal(dAtA []byte) error

type Message

type Message struct {
	MsgType          *MessageType `protobuf:"varint,1,opt,name=msg_type,json=msgType,enum=eraftpb.MessageType" json:"msg_type,omitempty"`
	To               *uint64      `protobuf:"varint,2,opt,name=to" json:"to,omitempty"`
	From             *uint64      `protobuf:"varint,3,opt,name=from" json:"from,omitempty"`
	Term             *uint64      `protobuf:"varint,4,opt,name=term" json:"term,omitempty"`
	LogTerm          *uint64      `protobuf:"varint,5,opt,name=log_term,json=logTerm" json:"log_term,omitempty"`
	Index            *uint64      `protobuf:"varint,6,opt,name=index" json:"index,omitempty"`
	Entries          []*Entry     `protobuf:"bytes,7,rep,name=entries" json:"entries,omitempty"`
	Commit           *uint64      `protobuf:"varint,8,opt,name=commit" json:"commit,omitempty"`
	Snapshot         *Snapshot    `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot,omitempty"`
	Reject           *bool        `protobuf:"varint,10,opt,name=reject" json:"reject,omitempty"`
	RejectHint       *uint64      `protobuf:"varint,11,opt,name=reject_hint,json=rejectHint" json:"reject_hint,omitempty"`
	Context          []byte       `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

func (*Message) Descriptor

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

func (*Message) GetCommit

func (m *Message) GetCommit() uint64

func (*Message) GetContext

func (m *Message) GetContext() []byte

func (*Message) GetEntries

func (m *Message) GetEntries() []*Entry

func (*Message) GetFrom

func (m *Message) GetFrom() uint64

func (*Message) GetIndex

func (m *Message) GetIndex() uint64

func (*Message) GetLogTerm

func (m *Message) GetLogTerm() uint64

func (*Message) GetMsgType

func (m *Message) GetMsgType() MessageType

func (*Message) GetReject

func (m *Message) GetReject() bool

func (*Message) GetRejectHint

func (m *Message) GetRejectHint() uint64

func (*Message) GetSnapshot

func (m *Message) GetSnapshot() *Snapshot

func (*Message) GetTerm

func (m *Message) GetTerm() uint64

func (*Message) GetTo

func (m *Message) GetTo() uint64

func (*Message) Marshal

func (m *Message) Marshal() (dAtA []byte, err error)

func (*Message) MarshalTo

func (m *Message) MarshalTo(dAtA []byte) (int, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

func (m *Message) Size() (n int)

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(dAtA []byte) error

type MessageType

type MessageType int32
const (
	MessageType_MsgHup                    MessageType = 0
	MessageType_MsgBeat                   MessageType = 1
	MessageType_MsgPropose                MessageType = 2
	MessageType_MsgAppend                 MessageType = 3
	MessageType_MsgAppendResponse         MessageType = 4
	MessageType_MsgRequestVote            MessageType = 5
	MessageType_MsgRequestVoteResponse    MessageType = 6
	MessageType_MsgSnapshot               MessageType = 7
	MessageType_MsgHeartbeat              MessageType = 8
	MessageType_MsgHeartbeatResponse      MessageType = 9
	MessageType_MsgUnreachable            MessageType = 10
	MessageType_MsgSnapStatus             MessageType = 11
	MessageType_MsgCheckQuorum            MessageType = 12
	MessageType_MsgTransferLeader         MessageType = 13
	MessageType_MsgTimeoutNow             MessageType = 14
	MessageType_MsgReadIndex              MessageType = 15
	MessageType_MsgReadIndexResp          MessageType = 16
	MessageType_MsgRequestPreVote         MessageType = 17
	MessageType_MsgRequestPreVoteResponse MessageType = 18
)

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor

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

func (MessageType) String

func (x MessageType) String() string

func (*MessageType) UnmarshalJSON

func (x *MessageType) UnmarshalJSON(data []byte) error

type Snapshot

type Snapshot struct {
	Data             []byte            `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
	Metadata         *SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"`
	XXX_unrecognized []byte            `json:"-"`
}

func (*Snapshot) Descriptor

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

func (*Snapshot) GetData

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

func (*Snapshot) GetMetadata

func (m *Snapshot) GetMetadata() *SnapshotMetadata

func (*Snapshot) Marshal

func (m *Snapshot) Marshal() (dAtA []byte, err error)

func (*Snapshot) MarshalTo

func (m *Snapshot) MarshalTo(dAtA []byte) (int, error)

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

func (m *Snapshot) Size() (n int)

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

func (m *Snapshot) Unmarshal(dAtA []byte) error

type SnapshotMetadata

type SnapshotMetadata struct {
	ConfState        *ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state,omitempty"`
	Index            *uint64    `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
	Term             *uint64    `protobuf:"varint,3,opt,name=term" json:"term,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (*SnapshotMetadata) Descriptor

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

func (*SnapshotMetadata) GetConfState

func (m *SnapshotMetadata) GetConfState() *ConfState

func (*SnapshotMetadata) GetIndex

func (m *SnapshotMetadata) GetIndex() uint64

func (*SnapshotMetadata) GetTerm

func (m *SnapshotMetadata) GetTerm() uint64

func (*SnapshotMetadata) Marshal

func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error)

func (*SnapshotMetadata) MarshalTo

func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error)

func (*SnapshotMetadata) ProtoMessage

func (*SnapshotMetadata) ProtoMessage()

func (*SnapshotMetadata) Reset

func (m *SnapshotMetadata) Reset()

func (*SnapshotMetadata) Size

func (m *SnapshotMetadata) Size() (n int)

func (*SnapshotMetadata) String

func (m *SnapshotMetadata) String() string

func (*SnapshotMetadata) Unmarshal

func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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