user_flex_feature_raft

package
v0.0.0-...-85cd7ee Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package user_flex_feature_raft is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	RaftService_Join_FullMethodName  = "/user_flex_feature_raft.v1.RaftService/Join"
	RaftService_Leave_FullMethodName = "/user_flex_feature_raft.v1.RaftService/Leave"
)

Variables

View Source
var File_docs_schema_user_flex_feature_raft_v1_schema_proto protoreflect.FileDescriptor
View Source
var RaftService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user_flex_feature_raft.v1.RaftService",
	HandlerType: (*RaftServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Join",
			Handler:    _RaftService_Join_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _RaftService_Leave_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "docs/schema/user-flex-feature-raft/v1/schema.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.

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.

func RegisterRaftServiceServer

func RegisterRaftServiceServer(s grpc.ServiceRegistrar, srv RaftServiceServer)

Types

type EmptyResponse

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

func (*EmptyResponse) Descriptor deprecated

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

Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.

func (*EmptyResponse) ProtoMessage

func (*EmptyResponse) ProtoMessage()

func (*EmptyResponse) ProtoReflect

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

func (*EmptyResponse) Reset

func (x *EmptyResponse) Reset()

func (*EmptyResponse) String

func (x *EmptyResponse) String() string

type JoinRequest

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

func (*JoinRequest) Descriptor deprecated

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

Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.

func (*JoinRequest) GetAddr

func (x *JoinRequest) GetAddr() string

func (*JoinRequest) GetId

func (x *JoinRequest) GetId() string

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) ProtoReflect

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

func (*JoinRequest) Reset

func (x *JoinRequest) Reset()

func (*JoinRequest) String

func (x *JoinRequest) String() string

type LeaveRequest

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

func (*LeaveRequest) Descriptor deprecated

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

Deprecated: Use LeaveRequest.ProtoReflect.Descriptor instead.

func (*LeaveRequest) GetId

func (x *LeaveRequest) GetId() string

func (*LeaveRequest) ProtoMessage

func (*LeaveRequest) ProtoMessage()

func (*LeaveRequest) ProtoReflect

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

func (*LeaveRequest) Reset

func (x *LeaveRequest) Reset()

func (*LeaveRequest) String

func (x *LeaveRequest) String() string

type RaftServiceClient

type RaftServiceClient interface {
	Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*EmptyResponse, error)
	Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*EmptyResponse, 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 {
	Join(context.Context, *JoinRequest) (*EmptyResponse, error)
	Leave(context.Context, *LeaveRequest) (*EmptyResponse, error)
}

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

type UnimplementedRaftServiceServer

type UnimplementedRaftServiceServer struct {
}

UnimplementedRaftServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedRaftServiceServer) Join

func (UnimplementedRaftServiceServer) Leave

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