proto

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	RaftService_ForwardApply_FullMethodName = "/raft.RaftService/ForwardApply"
)

Variables

View Source
var File_raft_proto_raft_proto protoreflect.FileDescriptor
View Source
var RaftService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "raft.RaftService",
	HandlerType: (*RaftServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ForwardApply",
			Handler:    _RaftService_ForwardApply_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "raft/proto/raft.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 RegisterRaftServiceHandler

func RegisterRaftServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRaftServiceHandler registers the http handlers for service RaftService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRaftServiceHandlerClient

func RegisterRaftServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RaftServiceClient) error

RegisterRaftServiceHandlerClient registers the http handlers for service RaftService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RaftServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RaftServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RaftServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterRaftServiceHandlerFromEndpoint

func RegisterRaftServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRaftServiceHandlerFromEndpoint is same as RegisterRaftServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRaftServiceHandlerServer

func RegisterRaftServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RaftServiceServer) error

RegisterRaftServiceHandlerServer registers the http handlers for service RaftService to "mux". UnaryRPC :call RaftServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRaftServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterRaftServiceServer

func RegisterRaftServiceServer(s grpc.ServiceRegistrar, srv RaftServiceServer)

Types

type ForwardApplyRequest

type ForwardApplyRequest struct {
	Data      []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	TimeoutMs int64  `protobuf:"varint,2,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardApplyRequest) Descriptor deprecated

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

Deprecated: Use ForwardApplyRequest.ProtoReflect.Descriptor instead.

func (*ForwardApplyRequest) GetData

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

func (*ForwardApplyRequest) GetTimeoutMs

func (x *ForwardApplyRequest) GetTimeoutMs() int64

func (*ForwardApplyRequest) ProtoMessage

func (*ForwardApplyRequest) ProtoMessage()

func (*ForwardApplyRequest) ProtoReflect

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

func (*ForwardApplyRequest) Reset

func (x *ForwardApplyRequest) Reset()

func (*ForwardApplyRequest) String

func (x *ForwardApplyRequest) String() string

type ForwardApplyResponse

type ForwardApplyResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardApplyResponse) Descriptor deprecated

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

Deprecated: Use ForwardApplyResponse.ProtoReflect.Descriptor instead.

func (*ForwardApplyResponse) GetError

func (x *ForwardApplyResponse) GetError() string

func (*ForwardApplyResponse) GetSuccess

func (x *ForwardApplyResponse) GetSuccess() bool

func (*ForwardApplyResponse) ProtoMessage

func (*ForwardApplyResponse) ProtoMessage()

func (*ForwardApplyResponse) ProtoReflect

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

func (*ForwardApplyResponse) Reset

func (x *ForwardApplyResponse) Reset()

func (*ForwardApplyResponse) String

func (x *ForwardApplyResponse) String() string

type RaftServiceClient

type RaftServiceClient interface {
	ForwardApply(ctx context.Context, in *ForwardApplyRequest, opts ...grpc.CallOption) (*ForwardApplyResponse, 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 {
	ForwardApply(context.Context, *ForwardApplyRequest) (*ForwardApplyResponse, error)
	// contains filtered or unexported methods
}

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

type UnimplementedRaftServiceServer

type UnimplementedRaftServiceServer struct{}

UnimplementedRaftServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedRaftServiceServer) ForwardApply

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