Documentation
¶
Overview ¶
Package game is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterGameServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGameServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GameServiceClient) error
- func RegisterGameServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGameServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GameServiceServer) error
- func RegisterGameServiceServer(s grpc.ServiceRegistrar, srv GameServiceServer)
- type GameServiceClient
- type GameServiceServer
- type UnimplementedGameServiceServer
- type UnsafeGameServiceServer
Constants ¶
const ( GameService_GameStatusStream_FullMethodName = "/game.GameService/GameStatusStream" GameService_PhysicsStream_FullMethodName = "/game.GameService/PhysicsStream" )
Variables ¶
var File_game_game_proto protoreflect.FileDescriptor
var GameService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "game.GameService", HandlerType: (*GameServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GameStatusStream", Handler: _GameService_GameStatusStream_Handler, }, { MethodName: "PhysicsStream", Handler: _GameService_PhysicsStream_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "game/game.proto", }
GameService_ServiceDesc is the grpc.ServiceDesc for GameService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGameServiceHandler ¶
func RegisterGameServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGameServiceHandler registers the http handlers for service GameService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGameServiceHandlerClient ¶
func RegisterGameServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GameServiceClient) error
RegisterGameServiceHandlerClient registers the http handlers for service GameService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GameServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GameServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GameServiceClient" to call the correct interceptors.
func RegisterGameServiceHandlerFromEndpoint ¶
func RegisterGameServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGameServiceHandlerFromEndpoint is same as RegisterGameServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGameServiceHandlerServer ¶
func RegisterGameServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GameServiceServer) error
RegisterGameServiceHandlerServer registers the http handlers for service GameService to "mux". UnaryRPC :call GameServiceServer 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 RegisterGameServiceHandlerFromEndpoint instead.
func RegisterGameServiceServer ¶
func RegisterGameServiceServer(s grpc.ServiceRegistrar, srv GameServiceServer)
Types ¶
type GameServiceClient ¶
type GameServiceClient interface { GameStatusStream(ctx context.Context, in *rpc.GameStatusRequest, opts ...grpc.CallOption) (*rpc.GameStatusResponse, error) PhysicsStream(ctx context.Context, in *rpc.PhysicsRequest, opts ...grpc.CallOption) (*rpc.PhysicsResponse, error) }
GameServiceClient is the client API for GameService 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 NewGameServiceClient ¶
func NewGameServiceClient(cc grpc.ClientConnInterface) GameServiceClient
type GameServiceServer ¶
type GameServiceServer interface { GameStatusStream(context.Context, *rpc.GameStatusRequest) (*rpc.GameStatusResponse, error) PhysicsStream(context.Context, *rpc.PhysicsRequest) (*rpc.PhysicsResponse, error) // contains filtered or unexported methods }
GameServiceServer is the server API for GameService service. All implementations must embed UnimplementedGameServiceServer for forward compatibility
type UnimplementedGameServiceServer ¶
type UnimplementedGameServiceServer struct { }
UnimplementedGameServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGameServiceServer) GameStatusStream ¶ added in v0.1.12
func (UnimplementedGameServiceServer) GameStatusStream(context.Context, *rpc.GameStatusRequest) (*rpc.GameStatusResponse, error)
func (UnimplementedGameServiceServer) PhysicsStream ¶ added in v0.1.12
func (UnimplementedGameServiceServer) PhysicsStream(context.Context, *rpc.PhysicsRequest) (*rpc.PhysicsResponse, error)
type UnsafeGameServiceServer ¶
type UnsafeGameServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGameServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GameServiceServer will result in compilation errors.