Documentation ¶
Index ¶
- Constants
- func NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewRoomsServiceHandler(svc RoomsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type EventServiceClient
- type EventServiceHandler
- type RoomsServiceClient
- type RoomsServiceHandler
- type UnimplementedEventServiceHandler
- type UnimplementedRoomsServiceHandler
- func (UnimplementedRoomsServiceHandler) BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) CheckIfRoomExists(context.Context, *connect.Request[v1.CheckIfRoomExistsRequest]) (*connect.Response[v1.CheckIfRoomExistsResponse], error)
- func (UnimplementedRoomsServiceHandler) CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) GetBannedUsersFromRoom(context.Context, *connect.Request[v1.GetBannedUsersFromRoomRequest]) (*connect.Response[v1.GetBannedUsersFromRoomResponse], 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) GetUsersInRoom(context.Context, *connect.Request[v1.GetUsersInRoomRequest]) (*connect.Response[v1.GetUsersInRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) RemoveUserFromRoom(context.Context, *connect.Request[v1.RemoveUserFromRoomRequest]) (*connect.Response[v1.RemoveUserFromRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error)
- func (UnimplementedRoomsServiceHandler) UnbanUserFromRoom(context.Context, *connect.Request[v1.UnbanUserFromRoomRequest]) (*connect.Response[v1.UnbanUserFromRoomResponse], error)
- func (UnimplementedRoomsServiceHandler) UserFinishedAnswering(context.Context, *connect.Request[v1.UserFinishedAnsweringRequest]) (*connect.Response[v1.UserFinishedAnsweringResponse], error)
Constants ¶
const ( // EventServiceSubscribeRoomEventsProcedure is the fully-qualified name of the EventService's // SubscribeRoomEvents RPC. EventServiceSubscribeRoomEventsProcedure = "/connectrpc.rooms.v1.EventService/SubscribeRoomEvents" // EventServiceSubscribeAllRoomEventsProcedure is the fully-qualified name of the EventService's // SubscribeAllRoomEvents RPC. EventServiceSubscribeAllRoomEventsProcedure = "/connectrpc.rooms.v1.EventService/SubscribeAllRoomEvents" )
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 ( // 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" // RoomsServiceRemoveUserFromRoomProcedure is the fully-qualified name of the RoomsService's // RemoveUserFromRoom RPC. RoomsServiceRemoveUserFromRoomProcedure = "/connectrpc.rooms.v1.RoomsService/RemoveUserFromRoom" // RoomsServiceBanUserFromRoomProcedure is the fully-qualified name of the RoomsService's // BanUserFromRoom RPC. RoomsServiceBanUserFromRoomProcedure = "/connectrpc.rooms.v1.RoomsService/BanUserFromRoom" // RoomsServiceUnbanUserFromRoomProcedure is the fully-qualified name of the RoomsService's // UnbanUserFromRoom RPC. RoomsServiceUnbanUserFromRoomProcedure = "/connectrpc.rooms.v1.RoomsService/UnbanUserFromRoom" // RoomsServiceGetBannedUsersFromRoomProcedure is the fully-qualified name of the RoomsService's // GetBannedUsersFromRoom RPC. RoomsServiceGetBannedUsersFromRoomProcedure = "/connectrpc.rooms.v1.RoomsService/GetBannedUsersFromRoom" // 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" // RoomsServiceGetRoomProcedure is the fully-qualified name of the RoomsService's GetRoom RPC. RoomsServiceGetRoomProcedure = "/connectrpc.rooms.v1.RoomsService/GetRoom" // RoomsServiceGetUsersInRoomProcedure is the fully-qualified name of the RoomsService's // GetUsersInRoom RPC. RoomsServiceGetUsersInRoomProcedure = "/connectrpc.rooms.v1.RoomsService/GetUsersInRoom" // RoomsServiceCheckIfRoomExistsProcedure is the fully-qualified name of the RoomsService's // CheckIfRoomExists RPC. RoomsServiceCheckIfRoomExistsProcedure = "/connectrpc.rooms.v1.RoomsService/CheckIfRoomExists" // RoomsServiceUserFinishedAnsweringProcedure is the fully-qualified name of the RoomsService's // UserFinishedAnswering RPC. RoomsServiceUserFinishedAnsweringProcedure = "/connectrpc.rooms.v1.RoomsService/UserFinishedAnswering" )
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 (
// EventServiceName is the fully-qualified name of the EventService service.
EventServiceName = "connectrpc.rooms.v1.EventService"
)
const (
// RoomsServiceName is the fully-qualified name of the RoomsService service.
RoomsServiceName = "connectrpc.rooms.v1.RoomsService"
)
Variables ¶
This section is empty.
Functions ¶
func NewEventServiceHandler ¶ added in v0.7.0
func NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewEventServiceHandler 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 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 EventServiceClient ¶ added in v0.7.0
type EventServiceClient interface { // 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) }
EventServiceClient is a client for the connectrpc.rooms.v1.EventService service.
func NewEventServiceClient ¶ added in v0.7.0
func NewEventServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) EventServiceClient
NewEventServiceClient constructs a client for the connectrpc.rooms.v1.EventService 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 EventServiceHandler ¶ added in v0.7.0
type EventServiceHandler interface { // 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 }
EventServiceHandler is an implementation of the connectrpc.rooms.v1.EventService service.
type RoomsServiceClient ¶
type RoomsServiceClient interface { // Creates a room CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error) // Add an user to the room's user list RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error) // Removes an user from the room's user list RemoveUserFromRoom(context.Context, *connect.Request[v1.RemoveUserFromRoomRequest]) (*connect.Response[v1.RemoveUserFromRoomResponse], error) // Bans and removes an user from a room BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error) // Removes the user from a room's ban list UnbanUserFromRoom(context.Context, *connect.Request[v1.UnbanUserFromRoomRequest]) (*connect.Response[v1.UnbanUserFromRoomResponse], error) // Gets a room's banned users list GetBannedUsersFromRoom(context.Context, *connect.Request[v1.GetBannedUsersFromRoomRequest]) (*connect.Response[v1.GetBannedUsersFromRoomResponse], error) // Runs the start match process for a room StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error) // Get the number of questions of a room GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error) // Gets all the information for a certain room GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error) // Get a list of user IDs for a certain room GetUsersInRoom(context.Context, *connect.Request[v1.GetUsersInRoomRequest]) (*connect.Response[v1.GetUsersInRoomResponse], error) // Checks if a room exists CheckIfRoomExists(context.Context, *connect.Request[v1.CheckIfRoomExistsRequest]) (*connect.Response[v1.CheckIfRoomExistsResponse], error) // RPC to alert that a user finished answering, used to handle match ends UserFinishedAnswering(context.Context, *connect.Request[v1.UserFinishedAnsweringRequest]) (*connect.Response[v1.UserFinishedAnsweringResponse], 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 { // Creates a room CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error) // Add an user to the room's user list RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error) // Removes an user from the room's user list RemoveUserFromRoom(context.Context, *connect.Request[v1.RemoveUserFromRoomRequest]) (*connect.Response[v1.RemoveUserFromRoomResponse], error) // Bans and removes an user from a room BanUserFromRoom(context.Context, *connect.Request[v1.BanUserFromRoomRequest]) (*connect.Response[v1.BanUserFromRoomResponse], error) // Removes the user from a room's ban list UnbanUserFromRoom(context.Context, *connect.Request[v1.UnbanUserFromRoomRequest]) (*connect.Response[v1.UnbanUserFromRoomResponse], error) // Gets a room's banned users list GetBannedUsersFromRoom(context.Context, *connect.Request[v1.GetBannedUsersFromRoomRequest]) (*connect.Response[v1.GetBannedUsersFromRoomResponse], error) // Runs the start match process for a room StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error) // Get the number of questions of a room GetQuestionCount(context.Context, *connect.Request[v1.GetQuestionCountRequest]) (*connect.Response[v1.GetQuestionCountResponse], error) // Gets all the information for a certain room GetRoom(context.Context, *connect.Request[v1.GetRoomRequest]) (*connect.Response[v1.GetRoomResponse], error) // Get a list of user IDs for a certain room GetUsersInRoom(context.Context, *connect.Request[v1.GetUsersInRoomRequest]) (*connect.Response[v1.GetUsersInRoomResponse], error) // Checks if a room exists CheckIfRoomExists(context.Context, *connect.Request[v1.CheckIfRoomExistsRequest]) (*connect.Response[v1.CheckIfRoomExistsResponse], error) // RPC to alert that a user finished answering, used to handle match ends UserFinishedAnswering(context.Context, *connect.Request[v1.UserFinishedAnsweringRequest]) (*connect.Response[v1.UserFinishedAnsweringResponse], error) }
RoomsServiceHandler is an implementation of the connectrpc.rooms.v1.RoomsService service.
type UnimplementedEventServiceHandler ¶ added in v0.7.0
type UnimplementedEventServiceHandler struct{}
UnimplementedEventServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedEventServiceHandler) SubscribeAllRoomEvents ¶ added in v0.7.0
func (UnimplementedEventServiceHandler) SubscribeAllRoomEvents(context.Context, *connect.Request[v1.SubscribeAllRoomEventsRequest], *connect.ServerStream[v1.SubscribeAllRoomEventsResponse]) error
func (UnimplementedEventServiceHandler) SubscribeRoomEvents ¶ added in v0.7.0
func (UnimplementedEventServiceHandler) SubscribeRoomEvents(context.Context, *connect.Request[v1.SubscribeRoomEventsRequest], *connect.ServerStream[v1.SubscribeRoomEventsResponse]) error
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) CheckIfRoomExists ¶ added in v0.7.3
func (UnimplementedRoomsServiceHandler) CheckIfRoomExists(context.Context, *connect.Request[v1.CheckIfRoomExistsRequest]) (*connect.Response[v1.CheckIfRoomExistsResponse], error)
func (UnimplementedRoomsServiceHandler) CreateRoom ¶
func (UnimplementedRoomsServiceHandler) CreateRoom(context.Context, *connect.Request[v1.CreateRoomRequest]) (*connect.Response[v1.CreateRoomResponse], error)
func (UnimplementedRoomsServiceHandler) GetBannedUsersFromRoom ¶ added in v0.8.0
func (UnimplementedRoomsServiceHandler) GetBannedUsersFromRoom(context.Context, *connect.Request[v1.GetBannedUsersFromRoomRequest]) (*connect.Response[v1.GetBannedUsersFromRoomResponse], 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) GetUsersInRoom ¶ added in v0.6.7
func (UnimplementedRoomsServiceHandler) GetUsersInRoom(context.Context, *connect.Request[v1.GetUsersInRoomRequest]) (*connect.Response[v1.GetUsersInRoomResponse], error)
func (UnimplementedRoomsServiceHandler) RegisterUserInRoom ¶
func (UnimplementedRoomsServiceHandler) RegisterUserInRoom(context.Context, *connect.Request[v1.RegisterUserInRoomRequest]) (*connect.Response[v1.RegisterUserInRoomResponse], error)
func (UnimplementedRoomsServiceHandler) RemoveUserFromRoom ¶ added in v0.8.0
func (UnimplementedRoomsServiceHandler) RemoveUserFromRoom(context.Context, *connect.Request[v1.RemoveUserFromRoomRequest]) (*connect.Response[v1.RemoveUserFromRoomResponse], error)
func (UnimplementedRoomsServiceHandler) StartMatch ¶
func (UnimplementedRoomsServiceHandler) StartMatch(context.Context, *connect.Request[v1.StartMatchRequest]) (*connect.Response[v1.StartMatchResponse], error)
func (UnimplementedRoomsServiceHandler) UnbanUserFromRoom ¶ added in v0.8.0
func (UnimplementedRoomsServiceHandler) UnbanUserFromRoom(context.Context, *connect.Request[v1.UnbanUserFromRoomRequest]) (*connect.Response[v1.UnbanUserFromRoomResponse], error)
func (UnimplementedRoomsServiceHandler) UserFinishedAnswering ¶ added in v0.7.5
func (UnimplementedRoomsServiceHandler) UserFinishedAnswering(context.Context, *connect.Request[v1.UserFinishedAnsweringRequest]) (*connect.Response[v1.UserFinishedAnsweringResponse], error)