raft

package
v0.0.0-...-dde4a86 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyStateCommand_KSMType_name = map[int32]string{
		0: "UpdateKeyPiece",
		1: "NewGeneration",
		2: "OwnerComplete",
	}
	KeyStateCommand_KSMType_value = map[string]int32{
		"UpdateKeyPiece": 0,
		"NewGeneration":  1,
		"OwnerComplete":  2,
	}
)

Enum value maps for KeyStateCommand_KSMType.

View Source
var (
	Configuration_ConfigurationType_name = map[int32]string{
		0: "CurrentConfiguration",
		1: "FutureConfiguration",
	}
	Configuration_ConfigurationType_value = map[string]int32{
		"CurrentConfiguration": 0,
		"FutureConfiguration":  1,
	}
)

Enum value maps for Configuration_ConfigurationType.

View Source
var (
	Entry_EntryType_name = map[int32]string{
		0: "StateMachineCommand",
		1: "ConfigurationChange",
		2: "Demo",
		3: "KeyStateCommand",
	}
	Entry_EntryType_value = map[string]int32{
		"StateMachineCommand": 0,
		"ConfigurationChange": 1,
		"Demo":                2,
		"KeyStateCommand":     3,
	}
)

Enum value maps for Entry_EntryType.

View Source
var File_raft_raft_proto protoreflect.FileDescriptor
View Source
var RaftNetwork_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "raft.RaftNetwork",
	HandlerType: (*RaftNetworkServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AppendEntries",
			Handler:    _RaftNetwork_AppendEntries_Handler,
		},
		{
			MethodName: "RequestVote",
			Handler:    _RaftNetwork_RequestVote_Handler,
		},
		{
			MethodName: "ClientToLeaderRequest",
			Handler:    _RaftNetwork_ClientToLeaderRequest_Handler,
		},
		{
			MethodName: "InstallSnapshot",
			Handler:    _RaftNetwork_InstallSnapshot_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "raft/raft.proto",
}

RaftNetwork_ServiceDesc is the grpc.ServiceDesc for RaftNetwork service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRaftNetworkServer

func RegisterRaftNetworkServer(s grpc.ServiceRegistrar, srv RaftNetworkServer)

Types

type AppendEntriesRequest

type AppendEntriesRequest struct {
	Term         uint64   `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`                                       // required
	LeaderId     string   `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"`                // required
	PrevLogIndex uint64   `protobuf:"varint,3,opt,name=prev_log_index,json=prevLogIndex,proto3" json:"prev_log_index,omitempty"` // required
	PrevLogTerm  uint64   `protobuf:"varint,4,opt,name=prev_log_term,json=prevLogTerm,proto3" json:"prev_log_term,omitempty"`    // required
	Entries      []*Entry `protobuf:"bytes,5,rep,name=entries,proto3" json:"entries,omitempty"`                                  // optional
	LeaderCommit uint64   `protobuf:"varint,6,opt,name=leader_commit,json=leaderCommit,proto3" json:"leader_commit,omitempty"`   // required
	// contains filtered or unexported fields
}

func (*AppendEntriesRequest) Descriptor deprecated

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

Deprecated: Use AppendEntriesRequest.ProtoReflect.Descriptor instead.

func (*AppendEntriesRequest) GetEntries

func (x *AppendEntriesRequest) GetEntries() []*Entry

func (*AppendEntriesRequest) GetLeaderCommit

func (x *AppendEntriesRequest) GetLeaderCommit() uint64

func (*AppendEntriesRequest) GetLeaderId

func (x *AppendEntriesRequest) GetLeaderId() string

func (*AppendEntriesRequest) GetPrevLogIndex

func (x *AppendEntriesRequest) GetPrevLogIndex() uint64

func (*AppendEntriesRequest) GetPrevLogTerm

func (x *AppendEntriesRequest) GetPrevLogTerm() uint64

func (*AppendEntriesRequest) GetTerm

func (x *AppendEntriesRequest) GetTerm() uint64

func (*AppendEntriesRequest) ProtoMessage

func (*AppendEntriesRequest) ProtoMessage()

func (*AppendEntriesRequest) ProtoReflect

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

func (*AppendEntriesRequest) Reset

func (x *AppendEntriesRequest) Reset()

func (*AppendEntriesRequest) String

func (x *AppendEntriesRequest) String() string

type AppendEntriesResponse

type AppendEntriesResponse struct {
	Term      uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`                            // required
	NextIndex uint64 `protobuf:"varint,2,opt,name=next_index,json=nextIndex,proto3" json:"next_index,omitempty"` // required
	Success   bool   `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`                      // required
	// contains filtered or unexported fields
}

func (*AppendEntriesResponse) Descriptor deprecated

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

Deprecated: Use AppendEntriesResponse.ProtoReflect.Descriptor instead.

func (*AppendEntriesResponse) GetNextIndex

func (x *AppendEntriesResponse) GetNextIndex() uint64

func (*AppendEntriesResponse) GetSuccess

func (x *AppendEntriesResponse) GetSuccess() bool

func (*AppendEntriesResponse) GetTerm

func (x *AppendEntriesResponse) GetTerm() uint64

func (*AppendEntriesResponse) ProtoMessage

func (*AppendEntriesResponse) ProtoMessage()

func (*AppendEntriesResponse) ProtoReflect

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

func (*AppendEntriesResponse) Reset

func (x *AppendEntriesResponse) Reset()

func (*AppendEntriesResponse) String

func (x *AppendEntriesResponse) String() string

type Configuration

type Configuration struct {
	Type  Configuration_ConfigurationType `protobuf:"varint,1,opt,name=type,proto3,enum=raft.Configuration_ConfigurationType" json:"type,omitempty"` // required
	Nodes []*Node                         `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`                                          // required
	// contains filtered or unexported fields
}

func (*Configuration) Descriptor deprecated

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

Deprecated: Use Configuration.ProtoReflect.Descriptor instead.

func (*Configuration) GetNodes

func (x *Configuration) GetNodes() []*Node

func (*Configuration) GetType

func (*Configuration) ProtoMessage

func (*Configuration) ProtoMessage()

func (*Configuration) ProtoReflect

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

func (*Configuration) Reset

func (x *Configuration) Reset()

func (*Configuration) String

func (x *Configuration) String() string

type Configuration_ConfigurationType

type Configuration_ConfigurationType int32
const (
	Configuration_CurrentConfiguration Configuration_ConfigurationType = 0
	Configuration_FutureConfiguration  Configuration_ConfigurationType = 1
)

func (Configuration_ConfigurationType) Descriptor

func (Configuration_ConfigurationType) Enum

func (Configuration_ConfigurationType) EnumDescriptor deprecated

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

Deprecated: Use Configuration_ConfigurationType.Descriptor instead.

func (Configuration_ConfigurationType) Number

func (Configuration_ConfigurationType) String

func (Configuration_ConfigurationType) Type

type DemoCommand

type DemoCommand struct {
	Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // required
	// contains filtered or unexported fields
}

func (*DemoCommand) Descriptor deprecated

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

Deprecated: Use DemoCommand.ProtoReflect.Descriptor instead.

func (*DemoCommand) GetNumber

func (x *DemoCommand) GetNumber() uint64

func (*DemoCommand) ProtoMessage

func (*DemoCommand) ProtoMessage()

func (*DemoCommand) ProtoReflect

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

func (*DemoCommand) Reset

func (x *DemoCommand) Reset()

func (*DemoCommand) String

func (x *DemoCommand) String() string

type EmptyMessage

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

func (*EmptyMessage) Descriptor deprecated

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

Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead.

func (*EmptyMessage) ProtoMessage

func (*EmptyMessage) ProtoMessage()

func (*EmptyMessage) ProtoReflect

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

func (*EmptyMessage) Reset

func (x *EmptyMessage) Reset()

func (*EmptyMessage) String

func (x *EmptyMessage) String() string

type Entry

type Entry struct {
	Type       Entry_EntryType      `protobuf:"varint,1,opt,name=type,proto3,enum=raft.Entry_EntryType" json:"type,omitempty"`    // required
	Uuid       string               `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`                               // required
	Command    *StateMachineCommand `protobuf:"bytes,3,opt,name=command,proto3" json:"command,omitempty"`                         // optional
	Config     *Configuration       `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`                           // optional
	Demo       *DemoCommand         `protobuf:"bytes,5,opt,name=demo,proto3" json:"demo,omitempty"`                               // optional
	KeyCommand *KeyStateCommand     `protobuf:"bytes,6,opt,name=key_command,json=keyCommand,proto3" json:"key_command,omitempty"` // optional
	// contains filtered or unexported fields
}

func (*Entry) Descriptor deprecated

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

Deprecated: Use Entry.ProtoReflect.Descriptor instead.

func (*Entry) GetCommand

func (x *Entry) GetCommand() *StateMachineCommand

func (*Entry) GetConfig

func (x *Entry) GetConfig() *Configuration

func (*Entry) GetDemo

func (x *Entry) GetDemo() *DemoCommand

func (*Entry) GetKeyCommand

func (x *Entry) GetKeyCommand() *KeyStateCommand

func (*Entry) GetType

func (x *Entry) GetType() Entry_EntryType

func (*Entry) GetUuid

func (x *Entry) GetUuid() string

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) ProtoReflect

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

func (*Entry) Reset

func (x *Entry) Reset()

func (*Entry) String

func (x *Entry) String() string

type EntryRequest

type EntryRequest struct {
	SenderId string `protobuf:"bytes,1,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` // required
	Entry    *Entry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"`                       // required
	// contains filtered or unexported fields
}

func (*EntryRequest) Descriptor deprecated

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

Deprecated: Use EntryRequest.ProtoReflect.Descriptor instead.

func (*EntryRequest) GetEntry

func (x *EntryRequest) GetEntry() *Entry

func (*EntryRequest) GetSenderId

func (x *EntryRequest) GetSenderId() string

func (*EntryRequest) ProtoMessage

func (*EntryRequest) ProtoMessage()

func (*EntryRequest) ProtoReflect

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

func (*EntryRequest) Reset

func (x *EntryRequest) Reset()

func (*EntryRequest) String

func (x *EntryRequest) String() string

type Entry_EntryType

type Entry_EntryType int32
const (
	Entry_StateMachineCommand Entry_EntryType = 0
	Entry_ConfigurationChange Entry_EntryType = 1
	Entry_Demo                Entry_EntryType = 2
	Entry_KeyStateCommand     Entry_EntryType = 3
)

func (Entry_EntryType) Descriptor

func (Entry_EntryType) Enum

func (x Entry_EntryType) Enum() *Entry_EntryType

func (Entry_EntryType) EnumDescriptor deprecated

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

Deprecated: Use Entry_EntryType.Descriptor instead.

func (Entry_EntryType) Number

func (Entry_EntryType) String

func (x Entry_EntryType) String() string

func (Entry_EntryType) Type

type KeyStateCommand

type KeyStateCommand struct {
	Type KeyStateCommand_KSMType `protobuf:"varint,1,opt,name=type,proto3,enum=raft.KeyStateCommand_KSMType" json:"type,omitempty"`
	// UpdateKeyPiece arguments
	KeyOwner   *Node `protobuf:"bytes,2,opt,name=key_owner,json=keyOwner,proto3" json:"key_owner,omitempty"`    // optional
	KeyHolder  *Node `protobuf:"bytes,3,opt,name=key_holder,json=keyHolder,proto3" json:"key_holder,omitempty"` // optional
	Generation int64 `protobuf:"varint,4,opt,name=generation,proto3" json:"generation,omitempty"`               // optional
	// NewGeneration arguments
	NewNode string `protobuf:"bytes,5,opt,name=new_node,json=newNode,proto3" json:"new_node,omitempty"` // optional
	// OwnerCompete arguments
	OwnerComplete string `protobuf:"bytes,6,opt,name=owner_complete,json=ownerComplete,proto3" json:"owner_complete,omitempty"` // optional
	// contains filtered or unexported fields
}

func (*KeyStateCommand) Descriptor deprecated

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

Deprecated: Use KeyStateCommand.ProtoReflect.Descriptor instead.

func (*KeyStateCommand) GetGeneration

func (x *KeyStateCommand) GetGeneration() int64

func (*KeyStateCommand) GetKeyHolder

func (x *KeyStateCommand) GetKeyHolder() *Node

func (*KeyStateCommand) GetKeyOwner

func (x *KeyStateCommand) GetKeyOwner() *Node

func (*KeyStateCommand) GetNewNode

func (x *KeyStateCommand) GetNewNode() string

func (*KeyStateCommand) GetOwnerComplete

func (x *KeyStateCommand) GetOwnerComplete() string

func (*KeyStateCommand) GetType

func (*KeyStateCommand) ProtoMessage

func (*KeyStateCommand) ProtoMessage()

func (*KeyStateCommand) ProtoReflect

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

func (*KeyStateCommand) Reset

func (x *KeyStateCommand) Reset()

func (*KeyStateCommand) String

func (x *KeyStateCommand) String() string

type KeyStateCommand_KSMType

type KeyStateCommand_KSMType int32
const (
	KeyStateCommand_UpdateKeyPiece KeyStateCommand_KSMType = 0
	KeyStateCommand_NewGeneration  KeyStateCommand_KSMType = 1
	KeyStateCommand_OwnerComplete  KeyStateCommand_KSMType = 2
)

func (KeyStateCommand_KSMType) Descriptor

func (KeyStateCommand_KSMType) Enum

func (KeyStateCommand_KSMType) EnumDescriptor deprecated

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

Deprecated: Use KeyStateCommand_KSMType.Descriptor instead.

func (KeyStateCommand_KSMType) Number

func (KeyStateCommand_KSMType) String

func (x KeyStateCommand_KSMType) String() string

func (KeyStateCommand_KSMType) Type

type LogEntry

type LogEntry struct {
	Term  uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`  // required
	Entry *Entry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` // required
	// contains filtered or unexported fields
}

func (*LogEntry) Descriptor deprecated

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

Deprecated: Use LogEntry.ProtoReflect.Descriptor instead.

func (*LogEntry) GetEntry

func (x *LogEntry) GetEntry() *Entry

func (*LogEntry) GetTerm

func (x *LogEntry) GetTerm() uint64

func (*LogEntry) ProtoMessage

func (*LogEntry) ProtoMessage()

func (*LogEntry) ProtoReflect

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

func (*LogEntry) Reset

func (x *LogEntry) Reset()

func (*LogEntry) String

func (x *LogEntry) String() string

type Node

type Node struct {
	Ip         string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`                                   // required
	Port       string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"`                               // required
	CommonName string `protobuf:"bytes,3,opt,name=common_name,json=commonName,proto3" json:"common_name,omitempty"` // required
	NodeId     string `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`             // required
	// contains filtered or unexported fields
}

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetCommonName

func (x *Node) GetCommonName() string

func (*Node) GetIp

func (x *Node) GetIp() string

func (*Node) GetNodeId

func (x *Node) GetNodeId() string

func (*Node) GetPort

func (x *Node) GetPort() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type RaftNetworkClient

type RaftNetworkClient interface {
	AppendEntries(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
	RequestVote(ctx context.Context, in *RequestVoteRequest, opts ...grpc.CallOption) (*RequestVoteResponse, error)
	ClientToLeaderRequest(ctx context.Context, in *EntryRequest, opts ...grpc.CallOption) (*EmptyMessage, error)
	InstallSnapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error)
}

RaftNetworkClient is the client API for RaftNetwork service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type RaftNetworkServer

type RaftNetworkServer interface {
	AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
	RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
	ClientToLeaderRequest(context.Context, *EntryRequest) (*EmptyMessage, error)
	InstallSnapshot(context.Context, *SnapshotRequest) (*SnapshotResponse, error)
	// contains filtered or unexported methods
}

RaftNetworkServer is the server API for RaftNetwork service. All implementations must embed UnimplementedRaftNetworkServer for forward compatibility

type RequestVoteRequest

type RequestVoteRequest struct {
	Term         uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`                                       // required
	CandidateId  string `protobuf:"bytes,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`       // required
	LastLogIndex uint64 `protobuf:"varint,3,opt,name=last_log_index,json=lastLogIndex,proto3" json:"last_log_index,omitempty"` // required
	LastLogTerm  uint64 `protobuf:"varint,4,opt,name=last_log_term,json=lastLogTerm,proto3" json:"last_log_term,omitempty"`    // required
	// contains filtered or unexported fields
}

func (*RequestVoteRequest) Descriptor deprecated

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

Deprecated: Use RequestVoteRequest.ProtoReflect.Descriptor instead.

func (*RequestVoteRequest) GetCandidateId

func (x *RequestVoteRequest) GetCandidateId() string

func (*RequestVoteRequest) GetLastLogIndex

func (x *RequestVoteRequest) GetLastLogIndex() uint64

func (*RequestVoteRequest) GetLastLogTerm

func (x *RequestVoteRequest) GetLastLogTerm() uint64

func (*RequestVoteRequest) GetTerm

func (x *RequestVoteRequest) GetTerm() uint64

func (*RequestVoteRequest) ProtoMessage

func (*RequestVoteRequest) ProtoMessage()

func (*RequestVoteRequest) ProtoReflect

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

func (*RequestVoteRequest) Reset

func (x *RequestVoteRequest) Reset()

func (*RequestVoteRequest) String

func (x *RequestVoteRequest) String() string

type RequestVoteResponse

type RequestVoteResponse struct {
	Term        uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`                                  // required
	VoteGranted bool   `protobuf:"varint,2,opt,name=vote_granted,json=voteGranted,proto3" json:"vote_granted,omitempty"` // required
	// contains filtered or unexported fields
}

func (*RequestVoteResponse) Descriptor deprecated

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

Deprecated: Use RequestVoteResponse.ProtoReflect.Descriptor instead.

func (*RequestVoteResponse) GetTerm

func (x *RequestVoteResponse) GetTerm() uint64

func (*RequestVoteResponse) GetVoteGranted

func (x *RequestVoteResponse) GetVoteGranted() bool

func (*RequestVoteResponse) ProtoMessage

func (*RequestVoteResponse) ProtoMessage()

func (*RequestVoteResponse) ProtoReflect

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

func (*RequestVoteResponse) Reset

func (x *RequestVoteResponse) Reset()

func (*RequestVoteResponse) String

func (x *RequestVoteResponse) String() string

type SnapshotRequest

type SnapshotRequest struct {
	Term              uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`                                                      // required
	LeaderId          string `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"`                               // required
	LastIncludedIndex uint64 `protobuf:"varint,3,opt,name=last_included_index,json=lastIncludedIndex,proto3" json:"last_included_index,omitempty"` // required
	LastIncludedTerm  uint64 `protobuf:"varint,4,opt,name=last_included_term,json=lastIncludedTerm,proto3" json:"last_included_term,omitempty"`    // required
	Offset            uint64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`                                                  // required
	Data              []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`                                                       // required
	Done              bool   `protobuf:"varint,7,opt,name=done,proto3" json:"done,omitempty"`                                                      // required
	// contains filtered or unexported fields
}

func (*SnapshotRequest) Descriptor deprecated

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

Deprecated: Use SnapshotRequest.ProtoReflect.Descriptor instead.

func (*SnapshotRequest) GetData

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

func (*SnapshotRequest) GetDone

func (x *SnapshotRequest) GetDone() bool

func (*SnapshotRequest) GetLastIncludedIndex

func (x *SnapshotRequest) GetLastIncludedIndex() uint64

func (*SnapshotRequest) GetLastIncludedTerm

func (x *SnapshotRequest) GetLastIncludedTerm() uint64

func (*SnapshotRequest) GetLeaderId

func (x *SnapshotRequest) GetLeaderId() string

func (*SnapshotRequest) GetOffset

func (x *SnapshotRequest) GetOffset() uint64

func (*SnapshotRequest) GetTerm

func (x *SnapshotRequest) GetTerm() uint64

func (*SnapshotRequest) ProtoMessage

func (*SnapshotRequest) ProtoMessage()

func (*SnapshotRequest) ProtoReflect

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

func (*SnapshotRequest) Reset

func (x *SnapshotRequest) Reset()

func (*SnapshotRequest) String

func (x *SnapshotRequest) String() string

type SnapshotResponse

type SnapshotResponse struct {
	Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` // required
	// contains filtered or unexported fields
}

func (*SnapshotResponse) Descriptor deprecated

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

Deprecated: Use SnapshotResponse.ProtoReflect.Descriptor instead.

func (*SnapshotResponse) GetTerm

func (x *SnapshotResponse) GetTerm() uint64

func (*SnapshotResponse) ProtoMessage

func (*SnapshotResponse) ProtoMessage()

func (*SnapshotResponse) ProtoReflect

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

func (*SnapshotResponse) Reset

func (x *SnapshotResponse) Reset()

func (*SnapshotResponse) String

func (x *SnapshotResponse) String() string

type StateMachineCommand

type StateMachineCommand struct {
	Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // required
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`  // required
	//Used for Write command
	Data   []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`      // optional
	Offset int64  `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` // optional
	//Used for Write and Truncate commands
	Length int64 `protobuf:"varint,5,opt,name=length,proto3" json:"length,omitempty"` // optional
	//Used for Link and Rename commands
	OldPath string `protobuf:"bytes,6,opt,name=old_path,json=oldPath,proto3" json:"old_path,omitempty"` // optional
	NewPath string `protobuf:"bytes,7,opt,name=new_path,json=newPath,proto3" json:"new_path,omitempty"` // optional
	//Used for Create, Chmod and Mkdir commands
	Mode uint32 `protobuf:"varint,8,opt,name=mode,proto3" json:"mode,omitempty"` // optional
	//Used for Utimes command
	AccessSeconds     int64 `protobuf:"varint,9,opt,name=access_seconds,json=accessSeconds,proto3" json:"access_seconds,omitempty"`              // optional
	AccessNanoseconds int64 `protobuf:"varint,10,opt,name=access_nanoseconds,json=accessNanoseconds,proto3" json:"access_nanoseconds,omitempty"` // optional
	ModifySeconds     int64 `protobuf:"varint,11,opt,name=modify_seconds,json=modifySeconds,proto3" json:"modify_seconds,omitempty"`             // optional
	ModifyNanoseconds int64 `protobuf:"varint,12,opt,name=modify_nanoseconds,json=modifyNanoseconds,proto3" json:"modify_nanoseconds,omitempty"` // optional
	// contains filtered or unexported fields
}

func (*StateMachineCommand) Descriptor deprecated

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

Deprecated: Use StateMachineCommand.ProtoReflect.Descriptor instead.

func (*StateMachineCommand) GetAccessNanoseconds

func (x *StateMachineCommand) GetAccessNanoseconds() int64

func (*StateMachineCommand) GetAccessSeconds

func (x *StateMachineCommand) GetAccessSeconds() int64

func (*StateMachineCommand) GetData

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

func (*StateMachineCommand) GetLength

func (x *StateMachineCommand) GetLength() int64

func (*StateMachineCommand) GetMode

func (x *StateMachineCommand) GetMode() uint32

func (*StateMachineCommand) GetModifyNanoseconds

func (x *StateMachineCommand) GetModifyNanoseconds() int64

func (*StateMachineCommand) GetModifySeconds

func (x *StateMachineCommand) GetModifySeconds() int64

func (*StateMachineCommand) GetNewPath

func (x *StateMachineCommand) GetNewPath() string

func (*StateMachineCommand) GetOffset

func (x *StateMachineCommand) GetOffset() int64

func (*StateMachineCommand) GetOldPath

func (x *StateMachineCommand) GetOldPath() string

func (*StateMachineCommand) GetPath

func (x *StateMachineCommand) GetPath() string

func (*StateMachineCommand) GetType

func (x *StateMachineCommand) GetType() uint32

func (*StateMachineCommand) ProtoMessage

func (*StateMachineCommand) ProtoMessage()

func (*StateMachineCommand) ProtoReflect

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

func (*StateMachineCommand) Reset

func (x *StateMachineCommand) Reset()

func (*StateMachineCommand) String

func (x *StateMachineCommand) String() string

type UnimplementedRaftNetworkServer

type UnimplementedRaftNetworkServer struct {
}

UnimplementedRaftNetworkServer must be embedded to have forward compatible implementations.

func (UnimplementedRaftNetworkServer) AppendEntries

func (UnimplementedRaftNetworkServer) ClientToLeaderRequest

func (UnimplementedRaftNetworkServer) InstallSnapshot

func (UnimplementedRaftNetworkServer) RequestVote

type UnsafeRaftNetworkServer

type UnsafeRaftNetworkServer interface {
	// contains filtered or unexported methods
}

UnsafeRaftNetworkServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RaftNetworkServer will result in compilation errors.

Jump to

Keyboard shortcuts

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