protos

package
v0.0.0-...-9505d04 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_replica_proto protoreflect.FileDescriptor

Functions

func RegisterConsensusServiceServer

func RegisterConsensusServiceServer(s *grpc.Server, srv ConsensusServiceServer)

Types

type AppendEntriesMessage

type AppendEntriesMessage struct {
	Term         int32       `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
	LeaderId     int32       `protobuf:"varint,2,opt,name=leaderId,proto3" json:"leaderId,omitempty"`
	PrevLogIndex int32       `protobuf:"varint,3,opt,name=prevLogIndex,proto3" json:"prevLogIndex,omitempty"`
	PrevLogTerm  int32       `protobuf:"varint,4,opt,name=prevLogTerm,proto3" json:"prevLogTerm,omitempty"`
	LeaderCommit int32       `protobuf:"varint,5,opt,name=leaderCommit,proto3" json:"leaderCommit,omitempty"`
	Entries      []*LogEntry `protobuf:"bytes,6,rep,name=entries,proto3" json:"entries,omitempty"`
	LeaderAddr   string      `protobuf:"bytes,7,opt,name=leaderAddr,proto3" json:"leaderAddr,omitempty"`
	LatestClient string      `protobuf:"bytes,8,opt,name=latestClient,proto3" json:"latestClient,omitempty"`
	// contains filtered or unexported fields
}

func (*AppendEntriesMessage) Descriptor deprecated

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

Deprecated: Use AppendEntriesMessage.ProtoReflect.Descriptor instead.

func (*AppendEntriesMessage) GetEntries

func (x *AppendEntriesMessage) GetEntries() []*LogEntry

func (*AppendEntriesMessage) GetLatestClient

func (x *AppendEntriesMessage) GetLatestClient() string

func (*AppendEntriesMessage) GetLeaderAddr

func (x *AppendEntriesMessage) GetLeaderAddr() string

func (*AppendEntriesMessage) GetLeaderCommit

func (x *AppendEntriesMessage) GetLeaderCommit() int32

func (*AppendEntriesMessage) GetLeaderId

func (x *AppendEntriesMessage) GetLeaderId() int32

func (*AppendEntriesMessage) GetPrevLogIndex

func (x *AppendEntriesMessage) GetPrevLogIndex() int32

func (*AppendEntriesMessage) GetPrevLogTerm

func (x *AppendEntriesMessage) GetPrevLogTerm() int32

func (*AppendEntriesMessage) GetTerm

func (x *AppendEntriesMessage) GetTerm() int32

func (*AppendEntriesMessage) ProtoMessage

func (*AppendEntriesMessage) ProtoMessage()

func (*AppendEntriesMessage) ProtoReflect

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

func (*AppendEntriesMessage) Reset

func (x *AppendEntriesMessage) Reset()

func (*AppendEntriesMessage) String

func (x *AppendEntriesMessage) String() string

type AppendEntriesResponse

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

func (*AppendEntriesResponse) Descriptor deprecated

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

Deprecated: Use AppendEntriesResponse.ProtoReflect.Descriptor instead.

func (*AppendEntriesResponse) GetSuccess

func (x *AppendEntriesResponse) GetSuccess() bool

func (*AppendEntriesResponse) GetTerm

func (x *AppendEntriesResponse) GetTerm() int32

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 ConsensusServiceClient

type ConsensusServiceClient interface {
	RequestVote(ctx context.Context, in *RequestVoteMessage, opts ...grpc.CallOption) (*RequestVoteResponse, error)
	AppendEntries(ctx context.Context, in *AppendEntriesMessage, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
}

ConsensusServiceClient is the client API for ConsensusService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ConsensusServiceServer

type ConsensusServiceServer interface {
	RequestVote(context.Context, *RequestVoteMessage) (*RequestVoteResponse, error)
	AppendEntries(context.Context, *AppendEntriesMessage) (*AppendEntriesResponse, error)
}

ConsensusServiceServer is the server API for ConsensusService service.

type LogEntry

type LogEntry struct {
	Term      int32    `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
	Operation []string `protobuf:"bytes,2,rep,name=operation,proto3" json:"operation,omitempty"` // [POST/PUT/DELETE/NO-OP] [<id, optional>] [<value, optional>]
	Clientid  string   `protobuf:"bytes,3,opt,name=clientid,proto3" json:"clientid,omitempty"`   // track which client made this entry
	// contains filtered or unexported fields
}

This is a format for representing a single log entry. Each log entry contains the value, and the term number, when it was added to the leader's log, and an identifier for the client that made the request.

func (*LogEntry) Descriptor deprecated

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

Deprecated: Use LogEntry.ProtoReflect.Descriptor instead.

func (*LogEntry) GetClientid

func (x *LogEntry) GetClientid() string

func (*LogEntry) GetOperation

func (x *LogEntry) GetOperation() []string

func (*LogEntry) GetTerm

func (x *LogEntry) GetTerm() int32

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 RequestVoteMessage

type RequestVoteMessage struct {
	Term         int32 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
	CandidateId  int32 `protobuf:"varint,2,opt,name=candidateId,proto3" json:"candidateId,omitempty"`
	LastLogIndex int32 `protobuf:"varint,3,opt,name=lastLogIndex,proto3" json:"lastLogIndex,omitempty"`
	LastLogTerm  int32 `protobuf:"varint,4,opt,name=lastLogTerm,proto3" json:"lastLogTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestVoteMessage) Descriptor deprecated

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

Deprecated: Use RequestVoteMessage.ProtoReflect.Descriptor instead.

func (*RequestVoteMessage) GetCandidateId

func (x *RequestVoteMessage) GetCandidateId() int32

func (*RequestVoteMessage) GetLastLogIndex

func (x *RequestVoteMessage) GetLastLogIndex() int32

func (*RequestVoteMessage) GetLastLogTerm

func (x *RequestVoteMessage) GetLastLogTerm() int32

func (*RequestVoteMessage) GetTerm

func (x *RequestVoteMessage) GetTerm() int32

func (*RequestVoteMessage) ProtoMessage

func (*RequestVoteMessage) ProtoMessage()

func (*RequestVoteMessage) ProtoReflect

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

func (*RequestVoteMessage) Reset

func (x *RequestVoteMessage) Reset()

func (*RequestVoteMessage) String

func (x *RequestVoteMessage) String() string

type RequestVoteResponse

type RequestVoteResponse struct {
	Term        int32 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
	VoteGranted bool  `protobuf:"varint,2,opt,name=voteGranted,proto3" json:"voteGranted,omitempty"`
	// 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() int32

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 UnimplementedConsensusServiceServer

type UnimplementedConsensusServiceServer struct {
}

UnimplementedConsensusServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedConsensusServiceServer) AppendEntries

func (*UnimplementedConsensusServiceServer) RequestVote

Jump to

Keyboard shortcuts

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