Documentation
¶
Index ¶
- Constants
- func NewRoomsServiceHandler(svc RoomsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type RoomsServiceClient
- type RoomsServiceHandler
- type UnimplementedRoomsServiceHandler
- func (UnimplementedRoomsServiceHandler) BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error)
- func (UnimplementedRoomsServiceHandler) GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error)
- func (UnimplementedRoomsServiceHandler) SubscribeAllRoomEvents(context.Context, *connect.Request[v1.SubscribeAllRoomEventsRequest], ...) error
- func (UnimplementedRoomsServiceHandler) SubscribeRoomEvents(context.Context, *connect.Request[v1.SubscribeRoomEventsRequest], ...) error
Constants ¶
const ( // RoomsServiceCreateRoomProcedure is the fully-qualified name of the RoomsService's CreateRoom RPC. RoomsServiceCreateRoomProcedure = "/connectrpc.rooms.v1.RoomsService/CreateRoom" // RoomsServiceRegisterUserInRoomProcedure is the fully-qualified name of the RoomsService's // RegisterUserInRoom RPC. RoomsServiceRegisterUserInRoomProcedure = "/connectrpc.rooms.v1.RoomsService/RegisterUserInRoom" // RoomsServiceBanUserFromRoomProcedure is the fully-qualified name of the RoomsService's // BanUserFromRoom RPC. RoomsServiceBanUserFromRoomProcedure = "/connectrpc.rooms.v1.RoomsService/BanUserFromRoom" // RoomsServiceStartMatchProcedure is the fully-qualified name of the RoomsService's StartMatch RPC. RoomsServiceStartMatchProcedure = "/connectrpc.rooms.v1.RoomsService/StartMatch" // RoomsServiceGetQuestionCountProcedure is the fully-qualified name of the RoomsService's // GetQuestionCount RPC. RoomsServiceGetQuestionCountProcedure = "/connectrpc.rooms.v1.RoomsService/GetQuestionCount" // RoomsServiceSubscribeRoomEventsProcedure is the fully-qualified name of the RoomsService's // SubscribeRoomEvents RPC. RoomsServiceSubscribeRoomEventsProcedure = "/connectrpc.rooms.v1.RoomsService/SubscribeRoomEvents" // RoomsServiceSubscribeAllRoomEventsProcedure is the fully-qualified name of the RoomsService's // SubscribeAllRoomEvents RPC. RoomsServiceSubscribeAllRoomEventsProcedure = "/connectrpc.rooms.v1.RoomsService/SubscribeAllRoomEvents" // RoomsServiceGetRoomProcedure is the fully-qualified name of the RoomsService's GetRoom RPC. RoomsServiceGetRoomProcedure = "/connectrpc.rooms.v1.RoomsService/GetRoom" )
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 (
// RoomsServiceName is the fully-qualified name of the RoomsService service.
RoomsServiceName = "connectrpc.rooms.v1.RoomsService"
)
Variables ¶
This section is empty.
Functions ¶
func NewRoomsServiceHandler ¶
func NewRoomsServiceHandler(svc RoomsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewRoomsServiceHandler 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 RoomsServiceClient ¶
type RoomsServiceClient interface { CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error) BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error) GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error) // RPC to get a stream of RoomEvents based on the roomId SubscribeRoomEvents(context.Context, *connect.Request[v1.SubscribeRoomEventsRequest]) (*connect.ServerStreamForClient[v1.SubscribeRoomEventsResponse], error) // RPC to get a stream of RoomEvents of all rooms SubscribeAllRoomEvents(context.Context, *connect.Request[v1.SubscribeAllRoomEventsRequest]) (*connect.ServerStreamForClient[v1.SubscribeAllRoomEventsResponse], error) // Gets all the information for a certain room GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error) }
RoomsServiceClient is a client for the connectrpc.rooms.v1.RoomsService service.
func NewRoomsServiceClient ¶
func NewRoomsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RoomsServiceClient
NewRoomsServiceClient constructs a client for the connectrpc.rooms.v1.RoomsService 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 RoomsServiceHandler ¶
type RoomsServiceHandler interface { CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error) BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error) GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error) // RPC to get a stream of RoomEvents based on the roomId SubscribeRoomEvents(context.Context, *connect.Request[v1.SubscribeRoomEventsRequest], *connect.ServerStream[v1.SubscribeRoomEventsResponse]) error // RPC to get a stream of RoomEvents of all rooms SubscribeAllRoomEvents(context.Context, *connect.Request[v1.SubscribeAllRoomEventsRequest], *connect.ServerStream[v1.SubscribeAllRoomEventsResponse]) error // Gets all the information for a certain room GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error) }
RoomsServiceHandler is an implementation of the connectrpc.rooms.v1.RoomsService service.
type UnimplementedRoomsServiceHandler ¶
type UnimplementedRoomsServiceHandler struct{}
UnimplementedRoomsServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedRoomsServiceHandler) BanUserFromRoom ¶
func (UnimplementedRoomsServiceHandler) BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error)
func (UnimplementedRoomsServiceHandler) CreateRoom ¶
func (UnimplementedRoomsServiceHandler) CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error)
func (UnimplementedRoomsServiceHandler) GetQuestionCount ¶
func (UnimplementedRoomsServiceHandler) GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error)
func (UnimplementedRoomsServiceHandler) GetRoom ¶ added in v0.6.3
func (UnimplementedRoomsServiceHandler) GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error)
func (UnimplementedRoomsServiceHandler) RegisterUserInRoom ¶
func (UnimplementedRoomsServiceHandler) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error)
func (UnimplementedRoomsServiceHandler) StartMatch ¶
func (UnimplementedRoomsServiceHandler) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error)
func (UnimplementedRoomsServiceHandler) SubscribeAllRoomEvents ¶
func (UnimplementedRoomsServiceHandler) SubscribeAllRoomEvents(context.Context, *connect.Request[v1.SubscribeAllRoomEventsRequest], *connect.ServerStream[v1.SubscribeAllRoomEventsResponse]) error
func (UnimplementedRoomsServiceHandler) SubscribeRoomEvents ¶
func (UnimplementedRoomsServiceHandler) SubscribeRoomEvents(context.Context, *connect.Request[v1.SubscribeRoomEventsRequest], *connect.ServerStream[v1.SubscribeRoomEventsResponse]) error