raftypb

package
v0.0.0-...-ef7c0cb Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Rafty_SendPreVoteRequest_FullMethodName       = "/raftypb.Rafty/SendPreVoteRequest"
	Rafty_SendVoteRequest_FullMethodName          = "/raftypb.Rafty/SendVoteRequest"
	Rafty_SetLeader_FullMethodName                = "/raftypb.Rafty/SetLeader"
	Rafty_GetLeader_FullMethodName                = "/raftypb.Rafty/GetLeader"
	Rafty_ClientGetLeader_FullMethodName          = "/raftypb.Rafty/ClientGetLeader"
	Rafty_SendAppendEntriesRequest_FullMethodName = "/raftypb.Rafty/SendAppendEntriesRequest"
	Rafty_AskNodeID_FullMethodName                = "/raftypb.Rafty/AskNodeID"
	Rafty_ForwardCommandToLeader_FullMethodName   = "/raftypb.Rafty/ForwardCommandToLeader"
)

Variables

View Source
var File_raftypb_requests_proto protoreflect.FileDescriptor
View Source
var Rafty_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "raftypb.Rafty",
	HandlerType: (*RaftyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendPreVoteRequest",
			Handler:    _Rafty_SendPreVoteRequest_Handler,
		},
		{
			MethodName: "SendVoteRequest",
			Handler:    _Rafty_SendVoteRequest_Handler,
		},
		{
			MethodName: "SetLeader",
			Handler:    _Rafty_SetLeader_Handler,
		},
		{
			MethodName: "GetLeader",
			Handler:    _Rafty_GetLeader_Handler,
		},
		{
			MethodName: "ClientGetLeader",
			Handler:    _Rafty_ClientGetLeader_Handler,
		},
		{
			MethodName: "SendAppendEntriesRequest",
			Handler:    _Rafty_SendAppendEntriesRequest_Handler,
		},
		{
			MethodName: "AskNodeID",
			Handler:    _Rafty_AskNodeID_Handler,
		},
		{
			MethodName: "ForwardCommandToLeader",
			Handler:    _Rafty_ForwardCommandToLeader_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "raftypb/requests.proto",
}

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

Functions

func RegisterRaftyServer

func RegisterRaftyServer(s grpc.ServiceRegistrar, srv RaftyServer)

Types

type AppendEntryRequest

type AppendEntryRequest struct {
	LeaderID          string      `protobuf:"bytes,1,opt,name=leaderID,proto3" json:"leaderID,omitempty"`
	LeaderAddress     string      `protobuf:"bytes,2,opt,name=leaderAddress,proto3" json:"leaderAddress,omitempty"`
	Term              uint64      `protobuf:"varint,3,opt,name=term,proto3" json:"term,omitempty"`
	PrevLogIndex      uint64      `protobuf:"varint,4,opt,name=prevLogIndex,proto3" json:"prevLogIndex,omitempty"`
	PrevLogTerm       uint64      `protobuf:"varint,5,opt,name=prevLogTerm,proto3" json:"prevLogTerm,omitempty"`
	Entries           []*LogEntry `protobuf:"bytes,6,rep,name=entries,proto3" json:"entries,omitempty"`
	LeaderCommitIndex uint64      `protobuf:"varint,7,opt,name=leaderCommitIndex,proto3" json:"leaderCommitIndex,omitempty"`
	Heartbeat         bool        `protobuf:"varint,8,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"`
	// contains filtered or unexported fields
}

func (*AppendEntryRequest) Descriptor deprecated

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

Deprecated: Use AppendEntryRequest.ProtoReflect.Descriptor instead.

func (*AppendEntryRequest) GetEntries

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

func (*AppendEntryRequest) GetHeartbeat

func (x *AppendEntryRequest) GetHeartbeat() bool

func (*AppendEntryRequest) GetLeaderAddress

func (x *AppendEntryRequest) GetLeaderAddress() string

func (*AppendEntryRequest) GetLeaderCommitIndex

func (x *AppendEntryRequest) GetLeaderCommitIndex() uint64

func (*AppendEntryRequest) GetLeaderID

func (x *AppendEntryRequest) GetLeaderID() string

func (*AppendEntryRequest) GetPrevLogIndex

func (x *AppendEntryRequest) GetPrevLogIndex() uint64

func (*AppendEntryRequest) GetPrevLogTerm

func (x *AppendEntryRequest) GetPrevLogTerm() uint64

func (*AppendEntryRequest) GetTerm

func (x *AppendEntryRequest) GetTerm() uint64

func (*AppendEntryRequest) ProtoMessage

func (*AppendEntryRequest) ProtoMessage()

func (*AppendEntryRequest) ProtoReflect

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

func (*AppendEntryRequest) Reset

func (x *AppendEntryRequest) Reset()

func (*AppendEntryRequest) String

func (x *AppendEntryRequest) String() string

type AppendEntryResponse

type AppendEntryResponse struct {
	Term    uint64 `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 (*AppendEntryResponse) Descriptor deprecated

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

Deprecated: Use AppendEntryResponse.ProtoReflect.Descriptor instead.

func (*AppendEntryResponse) GetSuccess

func (x *AppendEntryResponse) GetSuccess() bool

func (*AppendEntryResponse) GetTerm

func (x *AppendEntryResponse) GetTerm() uint64

func (*AppendEntryResponse) ProtoMessage

func (*AppendEntryResponse) ProtoMessage()

func (*AppendEntryResponse) ProtoReflect

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

func (*AppendEntryResponse) Reset

func (x *AppendEntryResponse) Reset()

func (*AppendEntryResponse) String

func (x *AppendEntryResponse) String() string

type AskNodeIDRequest

type AskNodeIDRequest struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*AskNodeIDRequest) Descriptor deprecated

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

Deprecated: Use AskNodeIDRequest.ProtoReflect.Descriptor instead.

func (*AskNodeIDRequest) GetAddress

func (x *AskNodeIDRequest) GetAddress() string

func (*AskNodeIDRequest) GetId

func (x *AskNodeIDRequest) GetId() string

func (*AskNodeIDRequest) ProtoMessage

func (*AskNodeIDRequest) ProtoMessage()

func (*AskNodeIDRequest) ProtoReflect

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

func (*AskNodeIDRequest) Reset

func (x *AskNodeIDRequest) Reset()

func (*AskNodeIDRequest) String

func (x *AskNodeIDRequest) String() string

type AskNodeIDResponse

type AskNodeIDResponse struct {
	PeerID string `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"`
	// contains filtered or unexported fields
}

func (*AskNodeIDResponse) Descriptor deprecated

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

Deprecated: Use AskNodeIDResponse.ProtoReflect.Descriptor instead.

func (*AskNodeIDResponse) GetPeerID

func (x *AskNodeIDResponse) GetPeerID() string

func (*AskNodeIDResponse) ProtoMessage

func (*AskNodeIDResponse) ProtoMessage()

func (*AskNodeIDResponse) ProtoReflect

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

func (*AskNodeIDResponse) Reset

func (x *AskNodeIDResponse) Reset()

func (*AskNodeIDResponse) String

func (x *AskNodeIDResponse) String() string

type ClientGetLeaderRequest

type ClientGetLeaderRequest struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientGetLeaderRequest) Descriptor deprecated

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

Deprecated: Use ClientGetLeaderRequest.ProtoReflect.Descriptor instead.

func (*ClientGetLeaderRequest) GetMessage

func (x *ClientGetLeaderRequest) GetMessage() string

func (*ClientGetLeaderRequest) ProtoMessage

func (*ClientGetLeaderRequest) ProtoMessage()

func (*ClientGetLeaderRequest) ProtoReflect

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

func (*ClientGetLeaderRequest) Reset

func (x *ClientGetLeaderRequest) Reset()

func (*ClientGetLeaderRequest) String

func (x *ClientGetLeaderRequest) String() string

type ClientGetLeaderResponse

type ClientGetLeaderResponse struct {
	LeaderID      string `protobuf:"bytes,1,opt,name=leaderID,proto3" json:"leaderID,omitempty"`
	LeaderAddress string `protobuf:"bytes,2,opt,name=leaderAddress,proto3" json:"leaderAddress,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientGetLeaderResponse) Descriptor deprecated

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

Deprecated: Use ClientGetLeaderResponse.ProtoReflect.Descriptor instead.

func (*ClientGetLeaderResponse) GetLeaderAddress

func (x *ClientGetLeaderResponse) GetLeaderAddress() string

func (*ClientGetLeaderResponse) GetLeaderID

func (x *ClientGetLeaderResponse) GetLeaderID() string

func (*ClientGetLeaderResponse) ProtoMessage

func (*ClientGetLeaderResponse) ProtoMessage()

func (*ClientGetLeaderResponse) ProtoReflect

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

func (*ClientGetLeaderResponse) Reset

func (x *ClientGetLeaderResponse) Reset()

func (*ClientGetLeaderResponse) String

func (x *ClientGetLeaderResponse) String() string

type ForwardCommandToLeaderRequest

type ForwardCommandToLeaderRequest struct {
	Command []byte `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardCommandToLeaderRequest) Descriptor deprecated

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

Deprecated: Use ForwardCommandToLeaderRequest.ProtoReflect.Descriptor instead.

func (*ForwardCommandToLeaderRequest) GetCommand

func (x *ForwardCommandToLeaderRequest) GetCommand() []byte

func (*ForwardCommandToLeaderRequest) ProtoMessage

func (*ForwardCommandToLeaderRequest) ProtoMessage()

func (*ForwardCommandToLeaderRequest) ProtoReflect

func (*ForwardCommandToLeaderRequest) Reset

func (x *ForwardCommandToLeaderRequest) Reset()

func (*ForwardCommandToLeaderRequest) String

type ForwardCommandToLeaderResponse

type ForwardCommandToLeaderResponse struct {
	Data  []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardCommandToLeaderResponse) Descriptor deprecated

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

Deprecated: Use ForwardCommandToLeaderResponse.ProtoReflect.Descriptor instead.

func (*ForwardCommandToLeaderResponse) GetData

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

func (*ForwardCommandToLeaderResponse) GetError

func (x *ForwardCommandToLeaderResponse) GetError() string

func (*ForwardCommandToLeaderResponse) ProtoMessage

func (*ForwardCommandToLeaderResponse) ProtoMessage()

func (*ForwardCommandToLeaderResponse) ProtoReflect

func (*ForwardCommandToLeaderResponse) Reset

func (x *ForwardCommandToLeaderResponse) Reset()

func (*ForwardCommandToLeaderResponse) String

type GetLeaderRequest

type GetLeaderRequest struct {
	PeerID      string `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"`
	PeerAddress string `protobuf:"bytes,2,opt,name=peerAddress,proto3" json:"peerAddress,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLeaderRequest) Descriptor deprecated

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

Deprecated: Use GetLeaderRequest.ProtoReflect.Descriptor instead.

func (*GetLeaderRequest) GetPeerAddress

func (x *GetLeaderRequest) GetPeerAddress() string

func (*GetLeaderRequest) GetPeerID

func (x *GetLeaderRequest) GetPeerID() string

func (*GetLeaderRequest) ProtoMessage

func (*GetLeaderRequest) ProtoMessage()

func (*GetLeaderRequest) ProtoReflect

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

func (*GetLeaderRequest) Reset

func (x *GetLeaderRequest) Reset()

func (*GetLeaderRequest) String

func (x *GetLeaderRequest) String() string

type GetLeaderResponse

type GetLeaderResponse struct {
	LeaderID      string `protobuf:"bytes,1,opt,name=leaderID,proto3" json:"leaderID,omitempty"`
	LeaderAddress string `protobuf:"bytes,2,opt,name=leaderAddress,proto3" json:"leaderAddress,omitempty"`
	PeerID        string `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLeaderResponse) Descriptor deprecated

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

Deprecated: Use GetLeaderResponse.ProtoReflect.Descriptor instead.

func (*GetLeaderResponse) GetLeaderAddress

func (x *GetLeaderResponse) GetLeaderAddress() string

func (*GetLeaderResponse) GetLeaderID

func (x *GetLeaderResponse) GetLeaderID() string

func (*GetLeaderResponse) GetPeerID

func (x *GetLeaderResponse) GetPeerID() string

func (*GetLeaderResponse) ProtoMessage

func (*GetLeaderResponse) ProtoMessage()

func (*GetLeaderResponse) ProtoReflect

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

func (*GetLeaderResponse) Reset

func (x *GetLeaderResponse) Reset()

func (*GetLeaderResponse) String

func (x *GetLeaderResponse) String() string

type LogEntry

type LogEntry struct {

	// should be uint8 but doesn't exist in pb,
	// so we take the closest
	FileFormat uint32 `protobuf:"varint,1,opt,name=fileFormat,proto3" json:"fileFormat,omitempty"`
	// should be uint8 but doesn't exist in pb,
	// so we take the closest
	Tombstone uint32 `protobuf:"varint,2,opt,name=tombstone,proto3" json:"tombstone,omitempty"`
	TimeStamp uint32 `protobuf:"varint,3,opt,name=timeStamp,proto3" json:"timeStamp,omitempty"`
	Term      uint64 `protobuf:"varint,4,opt,name=term,proto3" json:"term,omitempty"`
	Command   []byte `protobuf:"bytes,5,opt,name=command,proto3" json:"command,omitempty"`
	// contains filtered or unexported fields
}

func (*LogEntry) Descriptor deprecated

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

Deprecated: Use LogEntry.ProtoReflect.Descriptor instead.

func (*LogEntry) GetCommand

func (x *LogEntry) GetCommand() []byte

func (*LogEntry) GetFileFormat

func (x *LogEntry) GetFileFormat() uint32

func (*LogEntry) GetTerm

func (x *LogEntry) GetTerm() uint64

func (*LogEntry) GetTimeStamp

func (x *LogEntry) GetTimeStamp() uint32

func (*LogEntry) GetTombstone

func (x *LogEntry) GetTombstone() uint32

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 PersistMetadata

type PersistMetadata struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	CurrentTerm uint64 `protobuf:"varint,2,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	VotedFor    string `protobuf:"bytes,3,opt,name=votedFor,proto3" json:"votedFor,omitempty"`
	// contains filtered or unexported fields
}

func (*PersistMetadata) Descriptor deprecated

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

Deprecated: Use PersistMetadata.ProtoReflect.Descriptor instead.

func (*PersistMetadata) GetCurrentTerm

func (x *PersistMetadata) GetCurrentTerm() uint64

func (*PersistMetadata) GetId

func (x *PersistMetadata) GetId() string

func (*PersistMetadata) GetVotedFor

func (x *PersistMetadata) GetVotedFor() string

func (*PersistMetadata) ProtoMessage

func (*PersistMetadata) ProtoMessage()

func (*PersistMetadata) ProtoReflect

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

func (*PersistMetadata) Reset

func (x *PersistMetadata) Reset()

func (*PersistMetadata) String

func (x *PersistMetadata) String() string

type PreVoteRequest

type PreVoteRequest struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	State       string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	CurrentTerm uint64 `protobuf:"varint,3,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*PreVoteRequest) Descriptor deprecated

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

Deprecated: Use PreVoteRequest.ProtoReflect.Descriptor instead.

func (*PreVoteRequest) GetCurrentTerm

func (x *PreVoteRequest) GetCurrentTerm() uint64

func (*PreVoteRequest) GetId

func (x *PreVoteRequest) GetId() string

func (*PreVoteRequest) GetState

func (x *PreVoteRequest) GetState() string

func (*PreVoteRequest) ProtoMessage

func (*PreVoteRequest) ProtoMessage()

func (*PreVoteRequest) ProtoReflect

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

func (*PreVoteRequest) Reset

func (x *PreVoteRequest) Reset()

func (*PreVoteRequest) String

func (x *PreVoteRequest) String() string

type PreVoteResponse

type PreVoteResponse struct {
	PeerID      string `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"`
	State       string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	CurrentTerm uint64 `protobuf:"varint,3,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*PreVoteResponse) Descriptor deprecated

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

Deprecated: Use PreVoteResponse.ProtoReflect.Descriptor instead.

func (*PreVoteResponse) GetCurrentTerm

func (x *PreVoteResponse) GetCurrentTerm() uint64

func (*PreVoteResponse) GetPeerID

func (x *PreVoteResponse) GetPeerID() string

func (*PreVoteResponse) GetState

func (x *PreVoteResponse) GetState() string

func (*PreVoteResponse) ProtoMessage

func (*PreVoteResponse) ProtoMessage()

func (*PreVoteResponse) ProtoReflect

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

func (*PreVoteResponse) Reset

func (x *PreVoteResponse) Reset()

func (*PreVoteResponse) String

func (x *PreVoteResponse) String() string

type RaftyClient

type RaftyClient interface {
	SendPreVoteRequest(ctx context.Context, in *PreVoteRequest, opts ...grpc.CallOption) (*PreVoteResponse, error)
	SendVoteRequest(ctx context.Context, in *VoteRequest, opts ...grpc.CallOption) (*VoteResponse, error)
	SetLeader(ctx context.Context, in *SetLeaderRequest, opts ...grpc.CallOption) (*SetLeaderResponse, error)
	GetLeader(ctx context.Context, in *GetLeaderRequest, opts ...grpc.CallOption) (*GetLeaderResponse, error)
	ClientGetLeader(ctx context.Context, in *ClientGetLeaderRequest, opts ...grpc.CallOption) (*ClientGetLeaderResponse, error)
	SendAppendEntriesRequest(ctx context.Context, in *AppendEntryRequest, opts ...grpc.CallOption) (*AppendEntryResponse, error)
	AskNodeID(ctx context.Context, in *AskNodeIDRequest, opts ...grpc.CallOption) (*AskNodeIDResponse, error)
	ForwardCommandToLeader(ctx context.Context, in *ForwardCommandToLeaderRequest, opts ...grpc.CallOption) (*ForwardCommandToLeaderResponse, error)
}

RaftyClient is the client API for Rafty 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 NewRaftyClient

func NewRaftyClient(cc grpc.ClientConnInterface) RaftyClient

type RaftyServer

type RaftyServer interface {
	SendPreVoteRequest(context.Context, *PreVoteRequest) (*PreVoteResponse, error)
	SendVoteRequest(context.Context, *VoteRequest) (*VoteResponse, error)
	SetLeader(context.Context, *SetLeaderRequest) (*SetLeaderResponse, error)
	GetLeader(context.Context, *GetLeaderRequest) (*GetLeaderResponse, error)
	ClientGetLeader(context.Context, *ClientGetLeaderRequest) (*ClientGetLeaderResponse, error)
	SendAppendEntriesRequest(context.Context, *AppendEntryRequest) (*AppendEntryResponse, error)
	AskNodeID(context.Context, *AskNodeIDRequest) (*AskNodeIDResponse, error)
	ForwardCommandToLeader(context.Context, *ForwardCommandToLeaderRequest) (*ForwardCommandToLeaderResponse, error)
	// contains filtered or unexported methods
}

RaftyServer is the server API for Rafty service. All implementations must embed UnimplementedRaftyServer for forward compatibility

type SetLeaderRequest

type SetLeaderRequest struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Address     string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	CurrentTerm uint64 `protobuf:"varint,3,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*SetLeaderRequest) Descriptor deprecated

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

Deprecated: Use SetLeaderRequest.ProtoReflect.Descriptor instead.

func (*SetLeaderRequest) GetAddress

func (x *SetLeaderRequest) GetAddress() string

func (*SetLeaderRequest) GetCurrentTerm

func (x *SetLeaderRequest) GetCurrentTerm() uint64

func (*SetLeaderRequest) GetId

func (x *SetLeaderRequest) GetId() string

func (*SetLeaderRequest) ProtoMessage

func (*SetLeaderRequest) ProtoMessage()

func (*SetLeaderRequest) ProtoReflect

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

func (*SetLeaderRequest) Reset

func (x *SetLeaderRequest) Reset()

func (*SetLeaderRequest) String

func (x *SetLeaderRequest) String() string

type SetLeaderResponse

type SetLeaderResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*SetLeaderResponse) Descriptor deprecated

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

Deprecated: Use SetLeaderResponse.ProtoReflect.Descriptor instead.

func (*SetLeaderResponse) GetMessage

func (x *SetLeaderResponse) GetMessage() string

func (*SetLeaderResponse) ProtoMessage

func (*SetLeaderResponse) ProtoMessage()

func (*SetLeaderResponse) ProtoReflect

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

func (*SetLeaderResponse) Reset

func (x *SetLeaderResponse) Reset()

func (*SetLeaderResponse) String

func (x *SetLeaderResponse) String() string

type UnimplementedRaftyServer

type UnimplementedRaftyServer struct {
}

UnimplementedRaftyServer must be embedded to have forward compatible implementations.

func (UnimplementedRaftyServer) AskNodeID

func (UnimplementedRaftyServer) ClientGetLeader

func (UnimplementedRaftyServer) GetLeader

func (UnimplementedRaftyServer) SendAppendEntriesRequest

func (UnimplementedRaftyServer) SendPreVoteRequest

func (UnimplementedRaftyServer) SendVoteRequest

func (UnimplementedRaftyServer) SetLeader

type UnsafeRaftyServer

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

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

type VoteRequest

type VoteRequest struct {
	CandidateId      string `protobuf:"bytes,1,opt,name=candidateId,proto3" json:"candidateId,omitempty"`
	CandidateAddress string `protobuf:"bytes,2,opt,name=candidateAddress,proto3" json:"candidateAddress,omitempty"`
	State            string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
	CurrentTerm      uint64 `protobuf:"varint,4,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	LastLogIndex     uint64 `protobuf:"varint,5,opt,name=lastLogIndex,proto3" json:"lastLogIndex,omitempty"`
	LastLogTerm      uint64 `protobuf:"varint,6,opt,name=lastLogTerm,proto3" json:"lastLogTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*VoteRequest) Descriptor deprecated

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

Deprecated: Use VoteRequest.ProtoReflect.Descriptor instead.

func (*VoteRequest) GetCandidateAddress

func (x *VoteRequest) GetCandidateAddress() string

func (*VoteRequest) GetCandidateId

func (x *VoteRequest) GetCandidateId() string

func (*VoteRequest) GetCurrentTerm

func (x *VoteRequest) GetCurrentTerm() uint64

func (*VoteRequest) GetLastLogIndex

func (x *VoteRequest) GetLastLogIndex() uint64

func (*VoteRequest) GetLastLogTerm

func (x *VoteRequest) GetLastLogTerm() uint64

func (*VoteRequest) GetState

func (x *VoteRequest) GetState() string

func (*VoteRequest) ProtoMessage

func (*VoteRequest) ProtoMessage()

func (*VoteRequest) ProtoReflect

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

func (*VoteRequest) Reset

func (x *VoteRequest) Reset()

func (*VoteRequest) String

func (x *VoteRequest) String() string

type VoteResponse

type VoteResponse struct {
	VoteGranted       bool   `protobuf:"varint,1,opt,name=voteGranted,proto3" json:"voteGranted,omitempty"`
	CurrentTerm       uint64 `protobuf:"varint,2,opt,name=currentTerm,proto3" json:"currentTerm,omitempty"`
	PeerID            string `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"`
	NewLeaderDetected bool   `protobuf:"varint,4,opt,name=newLeaderDetected,proto3" json:"newLeaderDetected,omitempty"`
	RequesterStepDown bool   `protobuf:"varint,5,opt,name=requesterStepDown,proto3" json:"requesterStepDown,omitempty"`
	// contains filtered or unexported fields
}

func (*VoteResponse) Descriptor deprecated

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

Deprecated: Use VoteResponse.ProtoReflect.Descriptor instead.

func (*VoteResponse) GetCurrentTerm

func (x *VoteResponse) GetCurrentTerm() uint64

func (*VoteResponse) GetNewLeaderDetected

func (x *VoteResponse) GetNewLeaderDetected() bool

func (*VoteResponse) GetPeerID

func (x *VoteResponse) GetPeerID() string

func (*VoteResponse) GetRequesterStepDown

func (x *VoteResponse) GetRequesterStepDown() bool

func (*VoteResponse) GetVoteGranted

func (x *VoteResponse) GetVoteGranted() bool

func (*VoteResponse) ProtoMessage

func (*VoteResponse) ProtoMessage()

func (*VoteResponse) ProtoReflect

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

func (*VoteResponse) Reset

func (x *VoteResponse) Reset()

func (*VoteResponse) String

func (x *VoteResponse) String() string

Jump to

Keyboard shortcuts

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