Documentation ¶
Overview ¶
Package game_service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- 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 CreateGameRequest
- func (*CreateGameRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateGameRequest) GetImage() string
- func (x *CreateGameRequest) GetName() string
- func (*CreateGameRequest) ProtoMessage()
- func (x *CreateGameRequest) ProtoReflect() protoreflect.Message
- func (x *CreateGameRequest) Reset()
- func (x *CreateGameRequest) String() string
- type CreateGameResponse
- func (*CreateGameResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateGameResponse) GetId() string
- func (x *CreateGameResponse) GetImage() string
- func (x *CreateGameResponse) GetName() string
- func (*CreateGameResponse) ProtoMessage()
- func (x *CreateGameResponse) ProtoReflect() protoreflect.Message
- func (x *CreateGameResponse) Reset()
- func (x *CreateGameResponse) String() string
- type GameServiceClient
- type GameServiceServer
- type UnimplementedGameServiceServer
- type UnsafeGameServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_game_service_v1_game_service_proto protoreflect.FileDescriptor
var GameService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "game_service.v1.GameService", HandlerType: (*GameServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateGame", Handler: _GameService_CreateGame_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "game_service/v1/game_service.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 CreateGameRequest ¶
type CreateGameRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` // contains filtered or unexported fields }
func (*CreateGameRequest) Descriptor
deprecated
func (*CreateGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateGameRequest.ProtoReflect.Descriptor instead.
func (*CreateGameRequest) GetImage ¶
func (x *CreateGameRequest) GetImage() string
func (*CreateGameRequest) GetName ¶
func (x *CreateGameRequest) GetName() string
func (*CreateGameRequest) ProtoMessage ¶
func (*CreateGameRequest) ProtoMessage()
func (*CreateGameRequest) ProtoReflect ¶
func (x *CreateGameRequest) ProtoReflect() protoreflect.Message
func (*CreateGameRequest) Reset ¶
func (x *CreateGameRequest) Reset()
func (*CreateGameRequest) String ¶
func (x *CreateGameRequest) String() string
type CreateGameResponse ¶
type CreateGameResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` // contains filtered or unexported fields }
func (*CreateGameResponse) Descriptor
deprecated
func (*CreateGameResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateGameResponse.ProtoReflect.Descriptor instead.
func (*CreateGameResponse) GetId ¶
func (x *CreateGameResponse) GetId() string
func (*CreateGameResponse) GetImage ¶
func (x *CreateGameResponse) GetImage() string
func (*CreateGameResponse) GetName ¶
func (x *CreateGameResponse) GetName() string
func (*CreateGameResponse) ProtoMessage ¶
func (*CreateGameResponse) ProtoMessage()
func (*CreateGameResponse) ProtoReflect ¶
func (x *CreateGameResponse) ProtoReflect() protoreflect.Message
func (*CreateGameResponse) Reset ¶
func (x *CreateGameResponse) Reset()
func (*CreateGameResponse) String ¶
func (x *CreateGameResponse) String() string
type GameServiceClient ¶
type GameServiceClient interface { // Create new game CreateGame(ctx context.Context, in *CreateGameRequest, opts ...grpc.CallOption) (*CreateGameResponse, 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 { // Create new game CreateGame(context.Context, *CreateGameRequest) (*CreateGameResponse, 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) CreateGame ¶
func (UnimplementedGameServiceServer) CreateGame(context.Context, *CreateGameRequest) (*CreateGameResponse, 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.