v1

package
v0.0.0-...-ccef063 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RaftService_RequestVotes_FullMethodName  = "/rpc.v1.RaftService/RequestVotes"
	RaftService_AppendEntries_FullMethodName = "/rpc.v1.RaftService/AppendEntries"
)

Variables

View Source
var File_rpc_v1_rpc_proto protoreflect.FileDescriptor
View Source
var RaftService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.v1.RaftService",
	HandlerType: (*RaftServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RequestVotes",
			Handler:    _RaftService_RequestVotes_Handler,
		},
		{
			MethodName: "AppendEntries",
			Handler:    _RaftService_AppendEntries_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "rpc/v1/rpc.proto",
}

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

Functions

func RegisterRaftServiceServer

func RegisterRaftServiceServer(s grpc.ServiceRegistrar, srv RaftServiceServer)

Types

type AppendEntriesRequest

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

func (*AppendEntriesRequest) Descriptor deprecated

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

Deprecated: Use AppendEntriesRequest.ProtoReflect.Descriptor instead.

func (*AppendEntriesRequest) GetId

func (x *AppendEntriesRequest) GetId() string

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 {
	// contains filtered or unexported fields
}

func (*AppendEntriesResponse) Descriptor deprecated

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

Deprecated: Use AppendEntriesResponse.ProtoReflect.Descriptor instead.

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 Client

type Client struct {
	RaftServiceClient
}

func NewClient

func NewClient(runRPCClient *grpc.ClientConn) (*Client, error)

type RaftServiceClient

type RaftServiceClient interface {
	// RequestVotes is called by candidates to gather votes from other nodes.
	RequestVotes(ctx context.Context, in *RequestVotesRequest, opts ...grpc.CallOption) (*RequestVotesResponse, error)
	// AppendEntries is called by leaders to replicate log entries and provide a heartbeat.
	AppendEntries(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
}

RaftServiceClient is the client API for RaftService 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 RaftServiceServer

type RaftServiceServer interface {
	// RequestVotes is called by candidates to gather votes from other nodes.
	RequestVotes(context.Context, *RequestVotesRequest) (*RequestVotesResponse, error)
	// AppendEntries is called by leaders to replicate log entries and provide a heartbeat.
	AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
	// contains filtered or unexported methods
}

RaftServiceServer is the server API for RaftService service. All implementations must embed UnimplementedRaftServiceServer for forward compatibility

type RequestVotesRequest

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

func (*RequestVotesRequest) Descriptor deprecated

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

Deprecated: Use RequestVotesRequest.ProtoReflect.Descriptor instead.

func (*RequestVotesRequest) ProtoMessage

func (*RequestVotesRequest) ProtoMessage()

func (*RequestVotesRequest) ProtoReflect

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

func (*RequestVotesRequest) Reset

func (x *RequestVotesRequest) Reset()

func (*RequestVotesRequest) String

func (x *RequestVotesRequest) String() string

type RequestVotesResponse

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

func (*RequestVotesResponse) Descriptor deprecated

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

Deprecated: Use RequestVotesResponse.ProtoReflect.Descriptor instead.

func (*RequestVotesResponse) ProtoMessage

func (*RequestVotesResponse) ProtoMessage()

func (*RequestVotesResponse) ProtoReflect

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

func (*RequestVotesResponse) Reset

func (x *RequestVotesResponse) Reset()

func (*RequestVotesResponse) String

func (x *RequestVotesResponse) String() string

type Server

type Server struct {
	RaftServiceServer
}

func NewServer

func NewServer(runRPCServer *rpc.Server) (*Server, error)

type UnimplementedRaftServiceServer

type UnimplementedRaftServiceServer struct {
}

UnimplementedRaftServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRaftServiceServer) AppendEntries

func (UnimplementedRaftServiceServer) RequestVotes

type UnsafeRaftServiceServer

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

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

Jump to

Keyboard shortcuts

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