Documentation ¶
Index ¶
- Variables
- func RegisterAPIServiceServer(s grpc.ServiceRegistrar, srv APIServiceServer)
- func RegisterTransportServer(s grpc.ServiceRegistrar, srv TransportServer)
- type APIServiceClient
- type APIServiceServer
- type AppendEntriesRequest
- func (*AppendEntriesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AppendEntriesRequest) GetEntries() []*Log
- func (x *AppendEntriesRequest) GetLeaderCommit() uint64
- func (x *AppendEntriesRequest) GetLeaderId() string
- func (x *AppendEntriesRequest) GetPrevLogIndex() uint64
- func (x *AppendEntriesRequest) GetPrevLogTerm() uint64
- func (x *AppendEntriesRequest) GetTerm() uint64
- func (r *AppendEntriesRequest) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*AppendEntriesRequest) ProtoMessage()
- func (x *AppendEntriesRequest) ProtoReflect() protoreflect.Message
- func (x *AppendEntriesRequest) Reset()
- func (x *AppendEntriesRequest) String() string
- type AppendEntriesResponse
- func (*AppendEntriesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AppendEntriesResponse) GetServerId() string
- func (x *AppendEntriesResponse) GetStatus() ReplStatus
- func (x *AppendEntriesResponse) GetTerm() uint64
- func (*AppendEntriesResponse) ProtoMessage()
- func (x *AppendEntriesResponse) ProtoReflect() protoreflect.Message
- func (x *AppendEntriesResponse) Reset()
- func (x *AppendEntriesResponse) String() string
- type ApplyLogRequest
- type ApplyLogResponse
- func (*ApplyLogResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ApplyLogResponse) GetError() string
- func (x *ApplyLogResponse) GetMeta() *LogMeta
- func (m *ApplyLogResponse) GetResponse() isApplyLogResponse_Response
- func (*ApplyLogResponse) ProtoMessage()
- func (x *ApplyLogResponse) ProtoReflect() protoreflect.Message
- func (x *ApplyLogResponse) Reset()
- func (x *ApplyLogResponse) String() string
- type ApplyLogResponse_Error
- type ApplyLogResponse_Meta
- type Command
- func (*Command) Descriptor() ([]byte, []int)deprecated
- func (x *Command) GetData() []byte
- func (c *Command) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*Command) ProtoMessage()
- func (x *Command) ProtoReflect() protoreflect.Message
- func (x *Command) Reset()
- func (x *Command) String() string
- type Config
- func (c *Config) Copy() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetPeers() []*Peer
- func (c *Config) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type Configuration
- func (c *Configuration) Copy() *Configuration
- func (c *Configuration) CopyCommitTransition() *Configuration
- func (c *Configuration) CopyInitiateTransition(next *Config) *Configuration
- func (*Configuration) Descriptor() ([]byte, []int)deprecated
- func (x *Configuration) GetCurrent() *Config
- func (x *Configuration) GetNext() *Config
- func (c *Configuration) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*Configuration) ProtoMessage()
- func (x *Configuration) ProtoReflect() protoreflect.Message
- func (x *Configuration) Reset()
- func (x *Configuration) String() string
- type InstallSnapshotRequestData
- func (*InstallSnapshotRequestData) Descriptor() ([]byte, []int)deprecated
- func (x *InstallSnapshotRequestData) GetData() []byte
- func (*InstallSnapshotRequestData) ProtoMessage()
- func (x *InstallSnapshotRequestData) ProtoReflect() protoreflect.Message
- func (x *InstallSnapshotRequestData) Reset()
- func (x *InstallSnapshotRequestData) String() string
- type InstallSnapshotRequestMeta
- func (*InstallSnapshotRequestMeta) Descriptor() ([]byte, []int)deprecated
- func (x *InstallSnapshotRequestMeta) GetLastIncludedIndex() uint64
- func (x *InstallSnapshotRequestMeta) GetLastIncludedTerm() uint64
- func (x *InstallSnapshotRequestMeta) GetLeaderId() string
- func (x *InstallSnapshotRequestMeta) GetSnapshotMetadata() []byte
- func (x *InstallSnapshotRequestMeta) GetTerm() uint64
- func (*InstallSnapshotRequestMeta) ProtoMessage()
- func (x *InstallSnapshotRequestMeta) ProtoReflect() protoreflect.Message
- func (x *InstallSnapshotRequestMeta) Reset()
- func (x *InstallSnapshotRequestMeta) String() string
- type InstallSnapshotResponse
- func (*InstallSnapshotResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InstallSnapshotResponse) GetTerm() uint64
- func (*InstallSnapshotResponse) ProtoMessage()
- func (x *InstallSnapshotResponse) ProtoReflect() protoreflect.Message
- func (x *InstallSnapshotResponse) Reset()
- func (x *InstallSnapshotResponse) String() string
- type Log
- func (l *Log) Copy() *Log
- func (*Log) Descriptor() ([]byte, []int)deprecated
- func (x *Log) GetBody() *LogBody
- func (x *Log) GetMeta() *LogMeta
- func (l *Log) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*Log) ProtoMessage()
- func (x *Log) ProtoReflect() protoreflect.Message
- func (x *Log) Reset()
- func (x *Log) String() string
- type LogArray
- type LogBody
- func (b *LogBody) Copy() *LogBody
- func (*LogBody) Descriptor() ([]byte, []int)deprecated
- func (x *LogBody) GetData() []byte
- func (x *LogBody) GetType() LogType
- func (b *LogBody) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*LogBody) ProtoMessage()
- func (x *LogBody) ProtoReflect() protoreflect.Message
- func (x *LogBody) Reset()
- func (x *LogBody) String() string
- type LogMeta
- func (m *LogMeta) Copy() *LogMeta
- func (*LogMeta) Descriptor() ([]byte, []int)deprecated
- func (x *LogMeta) GetIndex() uint64
- func (x *LogMeta) GetTerm() uint64
- func (m *LogMeta) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*LogMeta) ProtoMessage()
- func (x *LogMeta) ProtoReflect() protoreflect.Message
- func (x *LogMeta) Reset()
- func (x *LogMeta) String() string
- type LogType
- type Peer
- func (p *Peer) Copy() *Peer
- func (*Peer) Descriptor() ([]byte, []int)deprecated
- func (x *Peer) GetEndpoint() string
- func (x *Peer) GetId() string
- func (p *Peer) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (*Peer) ProtoMessage()
- func (x *Peer) ProtoReflect() protoreflect.Message
- func (x *Peer) Reset()
- func (x *Peer) String() string
- type PeerArray
- type ReplStatus
- type RequestVoteRequest
- func (*RequestVoteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RequestVoteRequest) GetCandidateId() string
- func (x *RequestVoteRequest) GetLastLogIndex() uint64
- func (x *RequestVoteRequest) GetLastLogTerm() uint64
- func (x *RequestVoteRequest) GetTerm() uint64
- func (*RequestVoteRequest) ProtoMessage()
- func (x *RequestVoteRequest) ProtoReflect() protoreflect.Message
- func (x *RequestVoteRequest) Reset()
- func (x *RequestVoteRequest) String() string
- type RequestVoteResponse
- func (*RequestVoteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RequestVoteResponse) GetGranted() bool
- func (x *RequestVoteResponse) GetServerId() string
- func (x *RequestVoteResponse) GetTerm() uint64
- func (*RequestVoteResponse) ProtoMessage()
- func (x *RequestVoteResponse) ProtoReflect() protoreflect.Message
- func (x *RequestVoteResponse) Reset()
- func (x *RequestVoteResponse) String() string
- type TransportClient
- type TransportServer
- type Transport_InstallSnapshotClient
- type Transport_InstallSnapshotServer
- type UnimplementedAPIServiceServer
- type UnimplementedTransportServer
- func (UnimplementedTransportServer) AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
- func (UnimplementedTransportServer) ApplyLog(context.Context, *ApplyLogRequest) (*ApplyLogResponse, error)
- func (UnimplementedTransportServer) InstallSnapshot(Transport_InstallSnapshotServer) error
- func (UnimplementedTransportServer) RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
- type UnsafeAPIServiceServer
- type UnsafeTransportServer
Constants ¶
This section is empty.
Variables ¶
var ( LogType_name = map[int32]string{ 0: "UNKNOWN", 1: "COMMAND", 2: "CONFIGURATION", } LogType_value = map[string]int32{ "UNKNOWN": 0, "COMMAND": 1, "CONFIGURATION": 2, } )
Enum value maps for LogType.
var ( ReplStatus_name = map[int32]string{ 0: "REPL_UNKNOWN", 1: "REPL_OK", 2: "REPL_ERR_NO_LOG", 3: "REPL_ERR_STALE_TERM", 4: "REPL_ERR_INTERNAL", } ReplStatus_value = map[string]int32{ "REPL_UNKNOWN": 0, "REPL_OK": 1, "REPL_ERR_NO_LOG": 2, "REPL_ERR_STALE_TERM": 3, "REPL_ERR_INTERNAL": 4, } )
Enum value maps for ReplStatus.
var APIService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.APIService", HandlerType: (*APIServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Apply", Handler: _APIService_Apply_Handler, }, { MethodName: "ApplyCommand", Handler: _APIService_ApplyCommand_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apiservice.proto", }
APIService_ServiceDesc is the grpc.ServiceDesc for APIService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_apiservice_proto protoreflect.FileDescriptor
var File_command_proto protoreflect.FileDescriptor
var File_configuration_proto protoreflect.FileDescriptor
var File_log_proto protoreflect.FileDescriptor
var File_peer_proto protoreflect.FileDescriptor
var File_repl_proto protoreflect.FileDescriptor
var File_rpc_proto protoreflect.FileDescriptor
var File_transport_proto protoreflect.FileDescriptor
var NilLog = &Log{Meta: &LogMeta{Index: 0, Term: 0}}
var NilPeer = &Peer{Id: "", Endpoint: ""}
var Transport_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Transport", HandlerType: (*TransportServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AppendEntries", Handler: _Transport_AppendEntries_Handler, }, { MethodName: "RequestVote", Handler: _Transport_RequestVote_Handler, }, { MethodName: "ApplyLog", Handler: _Transport_ApplyLog_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "InstallSnapshot", Handler: _Transport_InstallSnapshot_Handler, ClientStreams: true, }, }, Metadata: "transport.proto", }
Transport_ServiceDesc is the grpc.ServiceDesc for Transport service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAPIServiceServer ¶
func RegisterAPIServiceServer(s grpc.ServiceRegistrar, srv APIServiceServer)
func RegisterTransportServer ¶
func RegisterTransportServer(s grpc.ServiceRegistrar, srv TransportServer)
Types ¶
type APIServiceClient ¶
type APIServiceClient interface { Apply(ctx context.Context, in *LogBody, opts ...grpc.CallOption) (*ApplyLogResponse, error) ApplyCommand(ctx context.Context, in *Command, opts ...grpc.CallOption) (*ApplyLogResponse, error) }
APIServiceClient is the client API for APIService 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.
func NewAPIServiceClient ¶
func NewAPIServiceClient(cc grpc.ClientConnInterface) APIServiceClient
type APIServiceServer ¶
type APIServiceServer interface { Apply(context.Context, *LogBody) (*ApplyLogResponse, error) ApplyCommand(context.Context, *Command) (*ApplyLogResponse, error) // contains filtered or unexported methods }
APIServiceServer is the server API for APIService service. All implementations must embed UnimplementedAPIServiceServer for forward compatibility
type AppendEntriesRequest ¶
type AppendEntriesRequest struct { Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` LeaderId string `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"` LeaderCommit uint64 `protobuf:"varint,3,opt,name=leader_commit,json=leaderCommit,proto3" json:"leader_commit,omitempty"` PrevLogIndex uint64 `protobuf:"varint,4,opt,name=prev_log_index,json=prevLogIndex,proto3" json:"prev_log_index,omitempty"` PrevLogTerm uint64 `protobuf:"varint,5,opt,name=prev_log_term,json=prevLogTerm,proto3" json:"prev_log_term,omitempty"` Entries []*Log `protobuf:"bytes,7,rep,name=entries,proto3" json:"entries,omitempty"` // 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() []*Log
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) MarshalLogObject ¶
func (r *AppendEntriesRequest) MarshalLogObject(e zapcore.ObjectEncoder) error
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 { ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"` Status ReplStatus `protobuf:"varint,3,opt,name=status,proto3,enum=pb.ReplStatus" json:"status,omitempty"` // contains filtered or unexported fields }
func (*AppendEntriesResponse) Descriptor
deprecated
func (*AppendEntriesResponse) Descriptor() ([]byte, []int)
Deprecated: Use AppendEntriesResponse.ProtoReflect.Descriptor instead.
func (*AppendEntriesResponse) GetServerId ¶
func (x *AppendEntriesResponse) GetServerId() string
func (*AppendEntriesResponse) GetStatus ¶
func (x *AppendEntriesResponse) GetStatus() ReplStatus
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 ApplyLogRequest ¶
type ApplyLogRequest struct { Body *LogBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*ApplyLogRequest) Descriptor
deprecated
func (*ApplyLogRequest) Descriptor() ([]byte, []int)
Deprecated: Use ApplyLogRequest.ProtoReflect.Descriptor instead.
func (*ApplyLogRequest) GetBody ¶
func (x *ApplyLogRequest) GetBody() *LogBody
func (*ApplyLogRequest) ProtoMessage ¶
func (*ApplyLogRequest) ProtoMessage()
func (*ApplyLogRequest) ProtoReflect ¶
func (x *ApplyLogRequest) ProtoReflect() protoreflect.Message
func (*ApplyLogRequest) Reset ¶
func (x *ApplyLogRequest) Reset()
func (*ApplyLogRequest) String ¶
func (x *ApplyLogRequest) String() string
type ApplyLogResponse ¶
type ApplyLogResponse struct { // Types that are assignable to Response: // *ApplyLogResponse_Meta // *ApplyLogResponse_Error Response isApplyLogResponse_Response `protobuf_oneof:"response"` // contains filtered or unexported fields }
func (*ApplyLogResponse) Descriptor
deprecated
func (*ApplyLogResponse) Descriptor() ([]byte, []int)
Deprecated: Use ApplyLogResponse.ProtoReflect.Descriptor instead.
func (*ApplyLogResponse) GetError ¶
func (x *ApplyLogResponse) GetError() string
func (*ApplyLogResponse) GetMeta ¶
func (x *ApplyLogResponse) GetMeta() *LogMeta
func (*ApplyLogResponse) GetResponse ¶
func (m *ApplyLogResponse) GetResponse() isApplyLogResponse_Response
func (*ApplyLogResponse) ProtoMessage ¶
func (*ApplyLogResponse) ProtoMessage()
func (*ApplyLogResponse) ProtoReflect ¶
func (x *ApplyLogResponse) ProtoReflect() protoreflect.Message
func (*ApplyLogResponse) Reset ¶
func (x *ApplyLogResponse) Reset()
func (*ApplyLogResponse) String ¶
func (x *ApplyLogResponse) String() string
type ApplyLogResponse_Error ¶
type ApplyLogResponse_Error struct {
Error string `protobuf:"bytes,2,opt,name=error,proto3,oneof"`
}
type ApplyLogResponse_Meta ¶
type ApplyLogResponse_Meta struct {
Meta *LogMeta `protobuf:"bytes,1,opt,name=meta,proto3,oneof"`
}
type Command ¶
type Command struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Command) Descriptor
deprecated
func (*Command) MarshalLogObject ¶
func (c *Command) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type Config ¶
type Config struct { Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) MarshalLogObject ¶
func (c *Config) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Configuration ¶
type Configuration struct { Current *Config `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"` Next *Config `protobuf:"bytes,2,opt,name=next,proto3" json:"next,omitempty"` // contains filtered or unexported fields }
func (*Configuration) Copy ¶
func (c *Configuration) Copy() *Configuration
func (*Configuration) CopyCommitTransition ¶
func (c *Configuration) CopyCommitTransition() *Configuration
func (*Configuration) CopyInitiateTransition ¶
func (c *Configuration) CopyInitiateTransition(next *Config) *Configuration
func (*Configuration) Descriptor
deprecated
func (*Configuration) Descriptor() ([]byte, []int)
Deprecated: Use Configuration.ProtoReflect.Descriptor instead.
func (*Configuration) GetCurrent ¶
func (x *Configuration) GetCurrent() *Config
func (*Configuration) GetNext ¶
func (x *Configuration) GetNext() *Config
func (*Configuration) MarshalLogObject ¶
func (c *Configuration) MarshalLogObject(e zapcore.ObjectEncoder) error
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 InstallSnapshotRequestData ¶
type InstallSnapshotRequestData struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*InstallSnapshotRequestData) Descriptor
deprecated
func (*InstallSnapshotRequestData) Descriptor() ([]byte, []int)
Deprecated: Use InstallSnapshotRequestData.ProtoReflect.Descriptor instead.
func (*InstallSnapshotRequestData) GetData ¶
func (x *InstallSnapshotRequestData) GetData() []byte
func (*InstallSnapshotRequestData) ProtoMessage ¶
func (*InstallSnapshotRequestData) ProtoMessage()
func (*InstallSnapshotRequestData) ProtoReflect ¶
func (x *InstallSnapshotRequestData) ProtoReflect() protoreflect.Message
func (*InstallSnapshotRequestData) Reset ¶
func (x *InstallSnapshotRequestData) Reset()
func (*InstallSnapshotRequestData) String ¶
func (x *InstallSnapshotRequestData) String() string
type InstallSnapshotRequestMeta ¶
type InstallSnapshotRequestMeta struct { Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` LeaderId string `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"` LastIncludedIndex uint64 `protobuf:"varint,3,opt,name=last_included_index,json=lastIncludedIndex,proto3" json:"last_included_index,omitempty"` LastIncludedTerm uint64 `protobuf:"varint,4,opt,name=last_included_term,json=lastIncludedTerm,proto3" json:"last_included_term,omitempty"` SnapshotMetadata []byte `protobuf:"bytes,5,opt,name=snapshot_metadata,json=snapshotMetadata,proto3" json:"snapshot_metadata,omitempty"` // contains filtered or unexported fields }
func (*InstallSnapshotRequestMeta) Descriptor
deprecated
func (*InstallSnapshotRequestMeta) Descriptor() ([]byte, []int)
Deprecated: Use InstallSnapshotRequestMeta.ProtoReflect.Descriptor instead.
func (*InstallSnapshotRequestMeta) GetLastIncludedIndex ¶
func (x *InstallSnapshotRequestMeta) GetLastIncludedIndex() uint64
func (*InstallSnapshotRequestMeta) GetLastIncludedTerm ¶
func (x *InstallSnapshotRequestMeta) GetLastIncludedTerm() uint64
func (*InstallSnapshotRequestMeta) GetLeaderId ¶
func (x *InstallSnapshotRequestMeta) GetLeaderId() string
func (*InstallSnapshotRequestMeta) GetSnapshotMetadata ¶
func (x *InstallSnapshotRequestMeta) GetSnapshotMetadata() []byte
func (*InstallSnapshotRequestMeta) GetTerm ¶
func (x *InstallSnapshotRequestMeta) GetTerm() uint64
func (*InstallSnapshotRequestMeta) ProtoMessage ¶
func (*InstallSnapshotRequestMeta) ProtoMessage()
func (*InstallSnapshotRequestMeta) ProtoReflect ¶
func (x *InstallSnapshotRequestMeta) ProtoReflect() protoreflect.Message
func (*InstallSnapshotRequestMeta) Reset ¶
func (x *InstallSnapshotRequestMeta) Reset()
func (*InstallSnapshotRequestMeta) String ¶
func (x *InstallSnapshotRequestMeta) String() string
type InstallSnapshotResponse ¶
type InstallSnapshotResponse struct { Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` // contains filtered or unexported fields }
func (*InstallSnapshotResponse) Descriptor
deprecated
func (*InstallSnapshotResponse) Descriptor() ([]byte, []int)
Deprecated: Use InstallSnapshotResponse.ProtoReflect.Descriptor instead.
func (*InstallSnapshotResponse) GetTerm ¶
func (x *InstallSnapshotResponse) GetTerm() uint64
func (*InstallSnapshotResponse) ProtoMessage ¶
func (*InstallSnapshotResponse) ProtoMessage()
func (*InstallSnapshotResponse) ProtoReflect ¶
func (x *InstallSnapshotResponse) ProtoReflect() protoreflect.Message
func (*InstallSnapshotResponse) Reset ¶
func (x *InstallSnapshotResponse) Reset()
func (*InstallSnapshotResponse) String ¶
func (x *InstallSnapshotResponse) String() string
type Log ¶
type Log struct { Meta *LogMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` Body *LogBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*Log) Descriptor
deprecated
func (*Log) MarshalLogObject ¶
func (l *Log) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) ProtoReflect ¶
func (x *Log) ProtoReflect() protoreflect.Message
type LogArray ¶
type LogArray []*Log
func (LogArray) MarshalLogArray ¶
func (a LogArray) MarshalLogArray(e zapcore.ArrayEncoder) error
type LogBody ¶
type LogBody struct { Type LogType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.LogType" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*LogBody) Descriptor
deprecated
func (*LogBody) MarshalLogObject ¶
func (b *LogBody) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*LogBody) ProtoMessage ¶
func (*LogBody) ProtoMessage()
func (*LogBody) ProtoReflect ¶
func (x *LogBody) ProtoReflect() protoreflect.Message
type LogMeta ¶
type LogMeta 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"` // contains filtered or unexported fields }
func (*LogMeta) Descriptor
deprecated
func (*LogMeta) MarshalLogObject ¶
func (m *LogMeta) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*LogMeta) ProtoMessage ¶
func (*LogMeta) ProtoMessage()
func (*LogMeta) ProtoReflect ¶
func (x *LogMeta) ProtoReflect() protoreflect.Message
type LogType ¶
type LogType int32
func (LogType) Descriptor ¶
func (LogType) Descriptor() protoreflect.EnumDescriptor
func (LogType) EnumDescriptor
deprecated
func (LogType) Number ¶
func (x LogType) Number() protoreflect.EnumNumber
func (LogType) Type ¶
func (LogType) Type() protoreflect.EnumType
type Peer ¶
type Peer struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // contains filtered or unexported fields }
func (*Peer) Descriptor
deprecated
func (*Peer) GetEndpoint ¶
func (*Peer) MarshalLogObject ¶
func (p *Peer) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*Peer) ProtoMessage ¶
func (*Peer) ProtoMessage()
func (*Peer) ProtoReflect ¶
func (x *Peer) ProtoReflect() protoreflect.Message
type PeerArray ¶
type PeerArray []*Peer
func (PeerArray) MarshalLogArray ¶
func (a PeerArray) MarshalLogArray(e zapcore.ArrayEncoder) error
type ReplStatus ¶
type ReplStatus int32
const ( ReplStatus_REPL_UNKNOWN ReplStatus = 0 ReplStatus_REPL_OK ReplStatus = 1 ReplStatus_REPL_ERR_NO_LOG ReplStatus = 2 ReplStatus_REPL_ERR_STALE_TERM ReplStatus = 3 ReplStatus_REPL_ERR_INTERNAL ReplStatus = 4 )
func (ReplStatus) Descriptor ¶
func (ReplStatus) Descriptor() protoreflect.EnumDescriptor
func (ReplStatus) Enum ¶
func (x ReplStatus) Enum() *ReplStatus
func (ReplStatus) EnumDescriptor
deprecated
func (ReplStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ReplStatus.Descriptor instead.
func (ReplStatus) Number ¶
func (x ReplStatus) Number() protoreflect.EnumNumber
func (ReplStatus) String ¶
func (x ReplStatus) String() string
func (ReplStatus) Type ¶
func (ReplStatus) Type() protoreflect.EnumType
type RequestVoteRequest ¶
type RequestVoteRequest struct { Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` CandidateId string `protobuf:"bytes,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"` LastLogIndex uint64 `protobuf:"varint,3,opt,name=last_log_index,json=lastLogIndex,proto3" json:"last_log_index,omitempty"` LastLogTerm uint64 `protobuf:"varint,4,opt,name=last_log_term,json=lastLogTerm,proto3" json:"last_log_term,omitempty"` // 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 { ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"` Granted bool `protobuf:"varint,3,opt,name=granted,proto3" json:"granted,omitempty"` // contains filtered or unexported fields }
func (*RequestVoteResponse) Descriptor
deprecated
func (*RequestVoteResponse) Descriptor() ([]byte, []int)
Deprecated: Use RequestVoteResponse.ProtoReflect.Descriptor instead.
func (*RequestVoteResponse) GetGranted ¶
func (x *RequestVoteResponse) GetGranted() bool
func (*RequestVoteResponse) GetServerId ¶
func (x *RequestVoteResponse) GetServerId() string
func (*RequestVoteResponse) GetTerm ¶
func (x *RequestVoteResponse) GetTerm() uint64
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 TransportClient ¶
type TransportClient interface { AppendEntries(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error) RequestVote(ctx context.Context, in *RequestVoteRequest, opts ...grpc.CallOption) (*RequestVoteResponse, error) InstallSnapshot(ctx context.Context, opts ...grpc.CallOption) (Transport_InstallSnapshotClient, error) ApplyLog(ctx context.Context, in *ApplyLogRequest, opts ...grpc.CallOption) (*ApplyLogResponse, error) }
TransportClient is the client API for Transport 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.
func NewTransportClient ¶
func NewTransportClient(cc grpc.ClientConnInterface) TransportClient
type TransportServer ¶
type TransportServer interface { AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error) RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error) InstallSnapshot(Transport_InstallSnapshotServer) error ApplyLog(context.Context, *ApplyLogRequest) (*ApplyLogResponse, error) // contains filtered or unexported methods }
TransportServer is the server API for Transport service. All implementations must embed UnimplementedTransportServer for forward compatibility
type Transport_InstallSnapshotClient ¶
type Transport_InstallSnapshotClient interface { Send(*InstallSnapshotRequestData) error CloseAndRecv() (*InstallSnapshotResponse, error) grpc.ClientStream }
type Transport_InstallSnapshotServer ¶
type Transport_InstallSnapshotServer interface { SendAndClose(*InstallSnapshotResponse) error Recv() (*InstallSnapshotRequestData, error) grpc.ServerStream }
type UnimplementedAPIServiceServer ¶
type UnimplementedAPIServiceServer struct { }
UnimplementedAPIServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServiceServer) Apply ¶
func (UnimplementedAPIServiceServer) Apply(context.Context, *LogBody) (*ApplyLogResponse, error)
func (UnimplementedAPIServiceServer) ApplyCommand ¶
func (UnimplementedAPIServiceServer) ApplyCommand(context.Context, *Command) (*ApplyLogResponse, error)
type UnimplementedTransportServer ¶
type UnimplementedTransportServer struct { }
UnimplementedTransportServer must be embedded to have forward compatible implementations.
func (UnimplementedTransportServer) AppendEntries ¶
func (UnimplementedTransportServer) AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
func (UnimplementedTransportServer) ApplyLog ¶
func (UnimplementedTransportServer) ApplyLog(context.Context, *ApplyLogRequest) (*ApplyLogResponse, error)
func (UnimplementedTransportServer) InstallSnapshot ¶
func (UnimplementedTransportServer) InstallSnapshot(Transport_InstallSnapshotServer) error
func (UnimplementedTransportServer) RequestVote ¶
func (UnimplementedTransportServer) RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
type UnsafeAPIServiceServer ¶
type UnsafeAPIServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServiceServer will result in compilation errors.
type UnsafeTransportServer ¶
type UnsafeTransportServer interface {
// contains filtered or unexported methods
}
UnsafeTransportServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransportServer will result in compilation errors.