Documentation ¶
Overview ¶
Package protos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterServerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServerClient) error
- func RegisterServerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServerServer) error
- func RegisterServerServer(s grpc.ServiceRegistrar, srv ServerServer)
- type ServerClient
- type ServerServer
- type UnimplementedServerServer
- type UnsafeServerServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_protos_server_proto protoreflect.FileDescriptor
var Server_ServiceDesc = grpc.ServiceDesc{ ServiceName: "github.com.LTitan.Mebius.pkg.protos.Server", HandlerType: (*ServerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMachine", Handler: _Server_GetMachine_Handler, }, { MethodName: "Heartbeat", Handler: _Server_Heartbeat_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/protos/server.proto", }
Server_ServiceDesc is the grpc.ServiceDesc for Server service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServerHandler ¶
RegisterServerHandler registers the http handlers for service Server to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterServerHandlerClient ¶
func RegisterServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServerClient) error
RegisterServerHandlerClient registers the http handlers for service Server to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServerClient" to call the correct interceptors.
func RegisterServerHandlerFromEndpoint ¶
func RegisterServerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterServerHandlerFromEndpoint is same as RegisterServerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterServerHandlerServer ¶
func RegisterServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServerServer) error
RegisterServerHandlerServer registers the http handlers for service Server to "mux". UnaryRPC :call ServerServer 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 RegisterServerHandlerFromEndpoint instead.
func RegisterServerServer ¶
func RegisterServerServer(s grpc.ServiceRegistrar, srv ServerServer)
Types ¶
type ServerClient ¶
type ServerClient interface { GetMachine(ctx context.Context, in *types.ExampleRequest, opts ...grpc.CallOption) (*types.ExampleResponse, error) Heartbeat(ctx context.Context, in *types.HeartbeatRequest, opts ...grpc.CallOption) (*types.HeartbeatResponse, error) }
ServerClient is the client API for Server 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 NewServerClient ¶
func NewServerClient(cc grpc.ClientConnInterface) ServerClient
type ServerServer ¶
type ServerServer interface { GetMachine(context.Context, *types.ExampleRequest) (*types.ExampleResponse, error) Heartbeat(context.Context, *types.HeartbeatRequest) (*types.HeartbeatResponse, error) }
ServerServer is the server API for Server service. All implementations should embed UnimplementedServerServer for forward compatibility
type UnimplementedServerServer ¶
type UnimplementedServerServer struct { }
UnimplementedServerServer should be embedded to have forward compatible implementations.
func (UnimplementedServerServer) GetMachine ¶
func (UnimplementedServerServer) GetMachine(context.Context, *types.ExampleRequest) (*types.ExampleResponse, error)
func (UnimplementedServerServer) Heartbeat ¶
func (UnimplementedServerServer) Heartbeat(context.Context, *types.HeartbeatRequest) (*types.HeartbeatResponse, error)
type UnsafeServerServer ¶
type UnsafeServerServer interface {
// contains filtered or unexported methods
}
UnsafeServerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServerServer will result in compilation errors.