Documentation
¶
Index ¶
- Constants
- func NewGameServiceHandler(svc GameServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewJankenServiceHandler(svc JankenServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type GameServiceClient
- type GameServiceHandler
- type JankenServiceClient
- type JankenServiceHandler
- type UnimplementedGameServiceHandler
- func (UnimplementedGameServiceHandler) GetSessionV1(context.Context, *connect.Request[api.GameServiceGetSessionV1Request]) (*connect.Response[api.GameServiceGetSessionV1Response], error)
- func (UnimplementedGameServiceHandler) ListPlayingSessionsV1(context.Context, *connect.Request[api.GameServiceListPlayingSessionsV1Request]) (*connect.Response[api.GameServiceListPlayingSessionsV1Response], error)
- func (UnimplementedGameServiceHandler) StartPlayingV1(context.Context, *connect.Request[api.GameServiceStartPlayingV1Request]) (*connect.Response[api.GameServiceStartPlayingV1Response], error)
- type UnimplementedJankenServiceHandler
Constants ¶
const ( // GameServiceGetSessionV1Procedure is the fully-qualified name of the GameService's GetSessionV1 // RPC. GameServiceGetSessionV1Procedure = "/api.GameService/GetSessionV1" // GameServiceListPlayingSessionsV1Procedure is the fully-qualified name of the GameService's // ListPlayingSessionsV1 RPC. GameServiceListPlayingSessionsV1Procedure = "/api.GameService/ListPlayingSessionsV1" // GameServiceStartPlayingV1Procedure is the fully-qualified name of the GameService's // StartPlayingV1 RPC. GameServiceStartPlayingV1Procedure = "/api.GameService/StartPlayingV1" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// GameServiceName is the fully-qualified name of the GameService service.
GameServiceName = "api.GameService"
)
const ( // JankenServiceChooseHandV1Procedure is the fully-qualified name of the JankenService's // ChooseHandV1 RPC. JankenServiceChooseHandV1Procedure = "/api.JankenService/ChooseHandV1" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// JankenServiceName is the fully-qualified name of the JankenService service.
JankenServiceName = "api.JankenService"
)
Variables ¶
This section is empty.
Functions ¶
func NewGameServiceHandler ¶
func NewGameServiceHandler(svc GameServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewGameServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
func NewJankenServiceHandler ¶
func NewJankenServiceHandler(svc JankenServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewJankenServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type GameServiceClient ¶
type GameServiceClient interface {
// ゲームセッションを取得します。
GetSessionV1(context.Context, *connect.Request[api.GameServiceGetSessionV1Request]) (*connect.Response[api.GameServiceGetSessionV1Response], error)
// プレイ中のゲームセッションリストを取得します。
ListPlayingSessionsV1(context.Context, *connect.Request[api.GameServiceListPlayingSessionsV1Request]) (*connect.Response[api.GameServiceListPlayingSessionsV1Response], error)
// ゲームを開始します。
// なお、チート対策のためゲーム終了判定はサーバー側で行います。
StartPlayingV1(context.Context, *connect.Request[api.GameServiceStartPlayingV1Request]) (*connect.Response[api.GameServiceStartPlayingV1Response], error)
}
GameServiceClient is a client for the api.GameService service.
func NewGameServiceClient ¶
func NewGameServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) GameServiceClient
NewGameServiceClient constructs a client for the api.GameService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type GameServiceHandler ¶
type GameServiceHandler interface {
// ゲームセッションを取得します。
GetSessionV1(context.Context, *connect.Request[api.GameServiceGetSessionV1Request]) (*connect.Response[api.GameServiceGetSessionV1Response], error)
// プレイ中のゲームセッションリストを取得します。
ListPlayingSessionsV1(context.Context, *connect.Request[api.GameServiceListPlayingSessionsV1Request]) (*connect.Response[api.GameServiceListPlayingSessionsV1Response], error)
// ゲームを開始します。
// なお、チート対策のためゲーム終了判定はサーバー側で行います。
StartPlayingV1(context.Context, *connect.Request[api.GameServiceStartPlayingV1Request]) (*connect.Response[api.GameServiceStartPlayingV1Response], error)
}
GameServiceHandler is an implementation of the api.GameService service.
type JankenServiceClient ¶
type JankenServiceClient interface {
ChooseHandV1(context.Context, *connect.Request[api.JankenServiceChooseHandV1Request]) (*connect.Response[api.JankenServiceChooseHandV1Response], error)
}
JankenServiceClient is a client for the api.JankenService service.
func NewJankenServiceClient ¶
func NewJankenServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) JankenServiceClient
NewJankenServiceClient constructs a client for the api.JankenService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type JankenServiceHandler ¶
type JankenServiceHandler interface {
ChooseHandV1(context.Context, *connect.Request[api.JankenServiceChooseHandV1Request]) (*connect.Response[api.JankenServiceChooseHandV1Response], error)
}
JankenServiceHandler is an implementation of the api.JankenService service.
type UnimplementedGameServiceHandler ¶
type UnimplementedGameServiceHandler struct{}
UnimplementedGameServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedGameServiceHandler) GetSessionV1 ¶
func (UnimplementedGameServiceHandler) GetSessionV1(context.Context, *connect.Request[api.GameServiceGetSessionV1Request]) (*connect.Response[api.GameServiceGetSessionV1Response], error)
func (UnimplementedGameServiceHandler) ListPlayingSessionsV1 ¶
func (UnimplementedGameServiceHandler) ListPlayingSessionsV1(context.Context, *connect.Request[api.GameServiceListPlayingSessionsV1Request]) (*connect.Response[api.GameServiceListPlayingSessionsV1Response], error)
func (UnimplementedGameServiceHandler) StartPlayingV1 ¶
func (UnimplementedGameServiceHandler) StartPlayingV1(context.Context, *connect.Request[api.GameServiceStartPlayingV1Request]) (*connect.Response[api.GameServiceStartPlayingV1Response], error)
type UnimplementedJankenServiceHandler ¶
type UnimplementedJankenServiceHandler struct{}
UnimplementedJankenServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedJankenServiceHandler) ChooseHandV1 ¶
func (UnimplementedJankenServiceHandler) ChooseHandV1(context.Context, *connect.Request[api.JankenServiceChooseHandV1Request]) (*connect.Response[api.JankenServiceChooseHandV1Response], error)