protobuf

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_seaweed_raft_proto protoreflect.FileDescriptor

Functions

func RegisterRaftServer

func RegisterRaftServer(s *grpc.Server, srv RaftServer)

Types

type AppendEntriesRequest

type AppendEntriesRequest struct {
	Term         uint64      `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	PrevLogIndex uint64      `protobuf:"varint,2,opt,name=PrevLogIndex,proto3" json:"PrevLogIndex,omitempty"`
	PrevLogTerm  uint64      `protobuf:"varint,3,opt,name=PrevLogTerm,proto3" json:"PrevLogTerm,omitempty"`
	CommitIndex  uint64      `protobuf:"varint,4,opt,name=CommitIndex,proto3" json:"CommitIndex,omitempty"`
	LeaderName   string      `protobuf:"bytes,5,opt,name=LeaderName,proto3" json:"LeaderName,omitempty"`
	Entries      []*LogEntry `protobuf:"bytes,6,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) GetCommitIndex

func (x *AppendEntriesRequest) GetCommitIndex() uint64

func (*AppendEntriesRequest) GetEntries

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

func (*AppendEntriesRequest) GetLeaderName

func (x *AppendEntriesRequest) GetLeaderName() 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"`
	Index       uint64 `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"`
	CommitIndex uint64 `protobuf:"varint,3,opt,name=CommitIndex,proto3" json:"CommitIndex,omitempty"`
	Success     bool   `protobuf:"varint,4,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) GetCommitIndex

func (x *AppendEntriesResponse) GetCommitIndex() uint64

func (*AppendEntriesResponse) GetIndex

func (x *AppendEntriesResponse) GetIndex() 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 LogEntry

type LogEntry 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"`
	CommandName string `protobuf:"bytes,3,opt,name=CommandName,proto3" json:"CommandName,omitempty"`
	Command     []byte `protobuf:"bytes,4,opt,name=Command,proto3" json:"Command,omitempty"` // for nop-command
	// 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) GetCommandName

func (x *LogEntry) GetCommandName() string

func (*LogEntry) GetIndex

func (x *LogEntry) GetIndex() uint64

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 RaftClient

type RaftClient interface {
	OnSendVoteRequest(ctx context.Context, in *RequestVoteRequest, opts ...grpc.CallOption) (*RequestVoteResponse, error)
	OnSendAppendEntriesRequest(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
	OnSendSnapshotRequest(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error)
	OnSendSnapshotRecoveryRequest(ctx context.Context, in *SnapshotRecoveryRequest, opts ...grpc.CallOption) (*SnapshotRecoveryResponse, error)
}

RaftClient is the client API for Raft service.

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

func NewRaftClient

func NewRaftClient(cc grpc.ClientConnInterface) RaftClient

type RaftServer

type RaftServer interface {
	OnSendVoteRequest(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
	OnSendAppendEntriesRequest(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
	OnSendSnapshotRequest(context.Context, *SnapshotRequest) (*SnapshotResponse, error)
	OnSendSnapshotRecoveryRequest(context.Context, *SnapshotRecoveryRequest) (*SnapshotRecoveryResponse, error)
}

RaftServer is the server API for Raft service.

type RequestVoteRequest

type RequestVoteRequest struct {
	Term          uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	LastLogIndex  uint64 `protobuf:"varint,2,opt,name=LastLogIndex,proto3" json:"LastLogIndex,omitempty"`
	LastLogTerm   uint64 `protobuf:"varint,3,opt,name=LastLogTerm,proto3" json:"LastLogTerm,omitempty"`
	CandidateName string `protobuf:"bytes,4,opt,name=CandidateName,proto3" json:"CandidateName,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestVoteRequest) Descriptor deprecated

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

Deprecated: Use RequestVoteRequest.ProtoReflect.Descriptor instead.

func (*RequestVoteRequest) GetCandidateName

func (x *RequestVoteRequest) GetCandidateName() 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"`
	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() 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 SnapshotRecoveryRequest

type SnapshotRecoveryRequest struct {
	LeaderName string                          `protobuf:"bytes,1,opt,name=LeaderName,proto3" json:"LeaderName,omitempty"`
	LastIndex  uint64                          `protobuf:"varint,2,opt,name=LastIndex,proto3" json:"LastIndex,omitempty"`
	LastTerm   uint64                          `protobuf:"varint,3,opt,name=LastTerm,proto3" json:"LastTerm,omitempty"`
	Peers      []*SnapshotRecoveryRequest_Peer `protobuf:"bytes,4,rep,name=Peers,proto3" json:"Peers,omitempty"`
	State      []byte                          `protobuf:"bytes,5,opt,name=State,proto3" json:"State,omitempty"`
	// contains filtered or unexported fields
}

func (*SnapshotRecoveryRequest) Descriptor deprecated

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

Deprecated: Use SnapshotRecoveryRequest.ProtoReflect.Descriptor instead.

func (*SnapshotRecoveryRequest) GetLastIndex

func (x *SnapshotRecoveryRequest) GetLastIndex() uint64

func (*SnapshotRecoveryRequest) GetLastTerm

func (x *SnapshotRecoveryRequest) GetLastTerm() uint64

func (*SnapshotRecoveryRequest) GetLeaderName

func (x *SnapshotRecoveryRequest) GetLeaderName() string

func (*SnapshotRecoveryRequest) GetPeers

func (*SnapshotRecoveryRequest) GetState

func (x *SnapshotRecoveryRequest) GetState() []byte

func (*SnapshotRecoveryRequest) ProtoMessage

func (*SnapshotRecoveryRequest) ProtoMessage()

func (*SnapshotRecoveryRequest) ProtoReflect

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

func (*SnapshotRecoveryRequest) Reset

func (x *SnapshotRecoveryRequest) Reset()

func (*SnapshotRecoveryRequest) String

func (x *SnapshotRecoveryRequest) String() string

type SnapshotRecoveryRequest_Peer

type SnapshotRecoveryRequest_Peer struct {
	Name             string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	ConnectionString string `protobuf:"bytes,2,opt,name=ConnectionString,proto3" json:"ConnectionString,omitempty"`
	// contains filtered or unexported fields
}

func (*SnapshotRecoveryRequest_Peer) Descriptor deprecated

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

Deprecated: Use SnapshotRecoveryRequest_Peer.ProtoReflect.Descriptor instead.

func (*SnapshotRecoveryRequest_Peer) GetConnectionString

func (x *SnapshotRecoveryRequest_Peer) GetConnectionString() string

func (*SnapshotRecoveryRequest_Peer) GetName

func (x *SnapshotRecoveryRequest_Peer) GetName() string

func (*SnapshotRecoveryRequest_Peer) ProtoMessage

func (*SnapshotRecoveryRequest_Peer) ProtoMessage()

func (*SnapshotRecoveryRequest_Peer) ProtoReflect

func (*SnapshotRecoveryRequest_Peer) Reset

func (x *SnapshotRecoveryRequest_Peer) Reset()

func (*SnapshotRecoveryRequest_Peer) String

type SnapshotRecoveryResponse

type SnapshotRecoveryResponse 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"`
	CommitIndex uint64 `protobuf:"varint,3,opt,name=CommitIndex,proto3" json:"CommitIndex,omitempty"`
	// contains filtered or unexported fields
}

func (*SnapshotRecoveryResponse) Descriptor deprecated

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

Deprecated: Use SnapshotRecoveryResponse.ProtoReflect.Descriptor instead.

func (*SnapshotRecoveryResponse) GetCommitIndex

func (x *SnapshotRecoveryResponse) GetCommitIndex() uint64

func (*SnapshotRecoveryResponse) GetSuccess

func (x *SnapshotRecoveryResponse) GetSuccess() bool

func (*SnapshotRecoveryResponse) GetTerm

func (x *SnapshotRecoveryResponse) GetTerm() uint64

func (*SnapshotRecoveryResponse) ProtoMessage

func (*SnapshotRecoveryResponse) ProtoMessage()

func (*SnapshotRecoveryResponse) ProtoReflect

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

func (*SnapshotRecoveryResponse) Reset

func (x *SnapshotRecoveryResponse) Reset()

func (*SnapshotRecoveryResponse) String

func (x *SnapshotRecoveryResponse) String() string

type SnapshotRequest

type SnapshotRequest struct {
	LeaderName string `protobuf:"bytes,1,opt,name=LeaderName,proto3" json:"LeaderName,omitempty"`
	LastIndex  uint64 `protobuf:"varint,2,opt,name=LastIndex,proto3" json:"LastIndex,omitempty"`
	LastTerm   uint64 `protobuf:"varint,3,opt,name=LastTerm,proto3" json:"LastTerm,omitempty"`
	// contains filtered or unexported fields
}

func (*SnapshotRequest) Descriptor deprecated

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

Deprecated: Use SnapshotRequest.ProtoReflect.Descriptor instead.

func (*SnapshotRequest) GetLastIndex

func (x *SnapshotRequest) GetLastIndex() uint64

func (*SnapshotRequest) GetLastTerm

func (x *SnapshotRequest) GetLastTerm() uint64

func (*SnapshotRequest) GetLeaderName

func (x *SnapshotRequest) GetLeaderName() string

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 {
	Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
	// contains filtered or unexported fields
}

func (*SnapshotResponse) Descriptor deprecated

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

Deprecated: Use SnapshotResponse.ProtoReflect.Descriptor instead.

func (*SnapshotResponse) GetSuccess

func (x *SnapshotResponse) GetSuccess() bool

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 UnimplementedRaftServer

type UnimplementedRaftServer struct {
}

UnimplementedRaftServer can be embedded to have forward compatible implementations.

func (*UnimplementedRaftServer) OnSendAppendEntriesRequest

func (*UnimplementedRaftServer) OnSendSnapshotRecoveryRequest

func (*UnimplementedRaftServer) OnSendSnapshotRequest

func (*UnimplementedRaftServer) OnSendVoteRequest

Jump to

Keyboard shortcuts

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