Documentation
¶
Index ¶
- Constants
- func AuthMiddleware(tm *auth.TokenManager) func(http.Handler) http.Handler
- func BodyLimitMiddleware(maxBytes int64) func(http.Handler) http.Handler
- func CORSMiddleware(allowedOrigins []string) func(http.Handler) http.Handler
- func GRPCHookUnaryInterceptor(rm *runtime.GoRuntimeManager, luaVM *lua.LState, jsVM *goja.Runtime) grpc.UnaryServerInterceptor
- func GRPCMetricsUnaryInterceptor() grpc.UnaryServerInterceptor
- func HTTPHookMiddleware(rm *runtime.GoRuntimeManager, luaVM *lua.LState, jsVM *goja.Runtime, ...) http.HandlerFunc
- func MetricsMiddleware(next http.Handler) http.Handler
- func RateLimitMiddleware(limiter RateLimiter) func(http.Handler) http.Handler
- func RequestIDMiddleware(next http.Handler) http.Handler
- func SecurityHeadersMiddleware(next http.Handler) http.Handler
- type ApiServer
- func (s *ApiServer) AddFriends(ctx context.Context, req *apipb.AddFriendsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) AddGroupUsers(ctx context.Context, req *apipb.AddGroupUsersRequest) (*emptypb.Empty, error)
- func (s *ApiServer) AuthenticateApple(ctx context.Context, req *apipb.AuthenticateAppleRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateCustom(ctx context.Context, req *apipb.AuthenticateCustomRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateDevice(ctx context.Context, req *apipb.AuthenticateDeviceRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateEmail(ctx context.Context, req *apipb.AuthenticateEmailRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateFacebook(ctx context.Context, req *apipb.AuthenticateFacebookRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateFacebookInstantGame(ctx context.Context, req *apipb.AuthenticateFacebookInstantGameRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateGameCenter(ctx context.Context, req *apipb.AuthenticateGameCenterRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateGoogle(ctx context.Context, req *apipb.AuthenticateGoogleRequest) (*apipb.Session, error)
- func (s *ApiServer) AuthenticateSteam(ctx context.Context, req *apipb.AuthenticateSteamRequest) (*apipb.Session, error)
- func (s *ApiServer) BanGroupUsers(ctx context.Context, req *apipb.BanGroupUsersRequest) (*emptypb.Empty, error)
- func (s *ApiServer) BlockFriends(ctx context.Context, req *apipb.BlockFriendsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) CreateGroup(ctx context.Context, req *apipb.CreateGroupRequest) (*apipb.Group, error)
- func (s *ApiServer) DeleteAccount(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteFriends(ctx context.Context, req *apipb.DeleteFriendsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteGroup(ctx context.Context, req *apipb.DeleteGroupRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteLeaderboardRecord(ctx context.Context, req *apipb.DeleteLeaderboardRecordRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteNotifications(ctx context.Context, req *apipb.DeleteNotificationsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteStorageObjects(ctx context.Context, req *apipb.DeleteStorageObjectsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DeleteTournamentRecord(ctx context.Context, req *apipb.DeleteTournamentRecordRequest) (*emptypb.Empty, error)
- func (s *ApiServer) DemoteGroupUsers(ctx context.Context, req *apipb.DemoteGroupUsersRequest) (*emptypb.Empty, error)
- func (s *ApiServer) Event(ctx context.Context, req *apipb.Event) (*emptypb.Empty, error)
- func (s *ApiServer) GetAccount(ctx context.Context, req *emptypb.Empty) (*apipb.Account, error)
- func (s *ApiServer) GetMatchmakerStats(ctx context.Context, req *emptypb.Empty) (*apipb.MatchmakerStats, error)
- func (s *ApiServer) GetSubscription(ctx context.Context, req *apipb.GetSubscriptionRequest) (*apipb.ValidatedSubscription, error)
- func (s *ApiServer) GetUsers(ctx context.Context, req *apipb.GetUsersRequest) (*apipb.Users, error)
- func (s *ApiServer) Healthcheck(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)
- func (s *ApiServer) ImportFacebookFriends(ctx context.Context, req *apipb.ImportFacebookFriendsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) ImportSteamFriends(ctx context.Context, req *apipb.ImportSteamFriendsRequest) (*emptypb.Empty, error)
- func (s *ApiServer) JoinGroup(ctx context.Context, req *apipb.JoinGroupRequest) (*emptypb.Empty, error)
- func (s *ApiServer) JoinTournament(ctx context.Context, req *apipb.JoinTournamentRequest) (*emptypb.Empty, error)
- func (s *ApiServer) KickGroupUsers(ctx context.Context, req *apipb.KickGroupUsersRequest) (*emptypb.Empty, error)
- func (s *ApiServer) LeaveGroup(ctx context.Context, req *apipb.LeaveGroupRequest) (*emptypb.Empty, error)
- func (s *ApiServer) LinkApple(ctx context.Context, req *apipb.AccountApple) (*emptypb.Empty, error)
- func (s *ApiServer) LinkCustom(ctx context.Context, req *apipb.AccountCustom) (*emptypb.Empty, error)
- func (s *ApiServer) LinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
- func (s *ApiServer) LinkEmail(ctx context.Context, req *apipb.AccountEmail) (*emptypb.Empty, error)
- func (s *ApiServer) LinkFacebook(ctx context.Context, req *apipb.LinkFacebookRequest) (*emptypb.Empty, error)
- func (s *ApiServer) LinkFacebookInstantGame(ctx context.Context, req *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
- func (s *ApiServer) LinkGameCenter(ctx context.Context, req *apipb.AccountGameCenter) (*emptypb.Empty, error)
- func (s *ApiServer) LinkGoogle(ctx context.Context, req *apipb.AccountGoogle) (*emptypb.Empty, error)
- func (s *ApiServer) LinkSteam(ctx context.Context, req *apipb.LinkSteamRequest) (*emptypb.Empty, error)
- func (s *ApiServer) ListChannelMessages(ctx context.Context, req *apipb.ListChannelMessagesRequest) (*apipb.ChannelMessageList, error)
- func (s *ApiServer) ListFriends(ctx context.Context, req *apipb.ListFriendsRequest) (*apipb.FriendList, error)
- func (s *ApiServer) ListFriendsOfFriends(ctx context.Context, req *apipb.ListFriendsOfFriendsRequest) (*apipb.FriendsOfFriendsList, error)
- func (s *ApiServer) ListGroupUsers(ctx context.Context, req *apipb.ListGroupUsersRequest) (*apipb.GroupUserList, error)
- func (s *ApiServer) ListGroups(ctx context.Context, req *apipb.ListGroupsRequest) (*apipb.GroupList, error)
- func (s *ApiServer) ListLeaderboardRecords(ctx context.Context, req *apipb.ListLeaderboardRecordsRequest) (*apipb.LeaderboardRecordList, error)
- func (s *ApiServer) ListLeaderboardRecordsAroundOwner(ctx context.Context, req *apipb.ListLeaderboardRecordsAroundOwnerRequest) (*apipb.LeaderboardRecordList, error)
- func (s *ApiServer) ListMatches(ctx context.Context, req *apipb.ListMatchesRequest) (*apipb.MatchList, error)
- func (s *ApiServer) ListNotifications(ctx context.Context, req *apipb.ListNotificationsRequest) (*apipb.NotificationList, error)
- func (s *ApiServer) ListParties(ctx context.Context, req *apipb.ListPartiesRequest) (*apipb.PartyList, error)
- func (s *ApiServer) ListStorageObjects(ctx context.Context, req *apipb.ListStorageObjectsRequest) (*apipb.StorageObjectList, error)
- func (s *ApiServer) ListSubscriptions(ctx context.Context, req *apipb.ListSubscriptionsRequest) (*apipb.SubscriptionList, error)
- func (s *ApiServer) ListTournamentRecords(ctx context.Context, req *apipb.ListTournamentRecordsRequest) (*apipb.TournamentRecordList, error)
- func (s *ApiServer) ListTournamentRecordsAroundOwner(ctx context.Context, req *apipb.ListTournamentRecordsAroundOwnerRequest) (*apipb.TournamentRecordList, error)
- func (s *ApiServer) ListTournaments(ctx context.Context, req *apipb.ListTournamentsRequest) (*apipb.TournamentList, error)
- func (s *ApiServer) ListUserGroups(ctx context.Context, req *apipb.ListUserGroupsRequest) (*apipb.UserGroupList, error)
- func (s *ApiServer) PromoteGroupUsers(ctx context.Context, req *apipb.PromoteGroupUsersRequest) (*emptypb.Empty, error)
- func (s *ApiServer) ReadStorageObjects(ctx context.Context, req *apipb.ReadStorageObjectsRequest) (*apipb.StorageObjects, error)
- func (s *ApiServer) RpcFunc(ctx context.Context, req *apipb.Rpc) (*apipb.Rpc, error)
- func (s *ApiServer) SessionLogout(ctx context.Context, req *apipb.SessionLogoutRequest) (*emptypb.Empty, error)
- func (s *ApiServer) SessionRefresh(ctx context.Context, req *apipb.SessionRefreshRequest) (*apipb.Session, error)
- func (s *ApiServer) UnlinkApple(ctx context.Context, req *apipb.AccountApple) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkCustom(ctx context.Context, req *apipb.AccountCustom) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkEmail(ctx context.Context, req *apipb.AccountEmail) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkFacebook(ctx context.Context, req *apipb.AccountFacebook) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkFacebookInstantGame(ctx context.Context, req *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkGameCenter(ctx context.Context, req *apipb.AccountGameCenter) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkGoogle(ctx context.Context, req *apipb.AccountGoogle) (*emptypb.Empty, error)
- func (s *ApiServer) UnlinkSteam(ctx context.Context, req *apipb.AccountSteam) (*emptypb.Empty, error)
- func (s *ApiServer) UpdateAccount(ctx context.Context, req *apipb.UpdateAccountRequest) (*emptypb.Empty, error)
- func (s *ApiServer) UpdateGroup(ctx context.Context, req *apipb.UpdateGroupRequest) (*emptypb.Empty, error)
- func (s *ApiServer) ValidatePurchaseApple(ctx context.Context, req *apipb.ValidatePurchaseAppleRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *ApiServer) ValidatePurchaseFacebookInstant(ctx context.Context, req *apipb.ValidatePurchaseFacebookInstantRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *ApiServer) ValidatePurchaseGoogle(ctx context.Context, req *apipb.ValidatePurchaseGoogleRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *ApiServer) ValidatePurchaseHuawei(ctx context.Context, req *apipb.ValidatePurchaseHuaweiRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *ApiServer) ValidatePurchaseSamsung(ctx context.Context, req *apipb.ValidatePurchaseSamsungRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *ApiServer) ValidateSubscriptionApple(ctx context.Context, req *apipb.ValidateSubscriptionAppleRequest) (*apipb.ValidateSubscriptionResponse, error)
- func (s *ApiServer) ValidateSubscriptionGoogle(ctx context.Context, req *apipb.ValidateSubscriptionGoogleRequest) (*apipb.ValidateSubscriptionResponse, error)
- func (s *ApiServer) WriteLeaderboardRecord(ctx context.Context, req *apipb.WriteLeaderboardRecordRequest) (*apipb.LeaderboardRecord, error)
- func (s *ApiServer) WriteStorageObjects(ctx context.Context, req *apipb.WriteStorageObjectsRequest) (*apipb.StorageObjectAcks, error)
- func (s *ApiServer) WriteTournamentRecord(ctx context.Context, req *apipb.WriteTournamentRecordRequest) (*apipb.LeaderboardRecord, error)
- type AuthServer
- func (s *AuthServer) AuthenticateApple(ctx context.Context, req *apipb.AuthenticateAppleRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateCustom(ctx context.Context, req *apipb.AuthenticateCustomRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateDevice(ctx context.Context, req *apipb.AuthenticateDeviceRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateEmail(ctx context.Context, req *apipb.AuthenticateEmailRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateFacebook(ctx context.Context, req *apipb.AuthenticateFacebookRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateFacebookInstantGame(ctx context.Context, req *apipb.AuthenticateFacebookInstantGameRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateGameCenter(ctx context.Context, req *apipb.AuthenticateGameCenterRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateGoogle(ctx context.Context, req *apipb.AuthenticateGoogleRequest) (*apipb.Session, error)
- func (s *AuthServer) AuthenticateSteam(ctx context.Context, req *apipb.AuthenticateSteamRequest) (*apipb.Session, error)
- func (s *AuthServer) DeleteAccount(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *AuthServer) GetAccount(ctx context.Context, _ *emptypb.Empty) (*apipb.Account, error)
- func (s *AuthServer) LinkApple(ctx context.Context, req *apipb.AccountApple) (*emptypb.Empty, error)
- func (s *AuthServer) LinkCustom(ctx context.Context, req *apipb.AccountCustom) (*emptypb.Empty, error)
- func (s *AuthServer) LinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
- func (s *AuthServer) LinkEmail(ctx context.Context, req *apipb.AccountEmail) (*emptypb.Empty, error)
- func (s *AuthServer) LinkFacebook(ctx context.Context, req *apipb.LinkFacebookRequest) (*emptypb.Empty, error)
- func (s *AuthServer) LinkFacebookInstantGame(ctx context.Context, req *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
- func (s *AuthServer) LinkGameCenter(ctx context.Context, req *apipb.AccountGameCenter) (*emptypb.Empty, error)
- func (s *AuthServer) LinkGoogle(ctx context.Context, req *apipb.AccountGoogle) (*emptypb.Empty, error)
- func (s *AuthServer) LinkSteam(ctx context.Context, req *apipb.LinkSteamRequest) (*emptypb.Empty, error)
- func (s *AuthServer) SessionLogout(ctx context.Context, req *apipb.SessionLogoutRequest) (*emptypb.Empty, error)
- func (s *AuthServer) SessionRefresh(ctx context.Context, req *apipb.SessionRefreshRequest) (*apipb.Session, error)
- func (s *AuthServer) UnlinkApple(ctx context.Context, _ *apipb.AccountApple) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkCustom(ctx context.Context, _ *apipb.AccountCustom) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkEmail(ctx context.Context, _ *apipb.AccountEmail) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkFacebook(ctx context.Context, _ *apipb.AccountFacebook) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkFacebookInstantGame(ctx context.Context, _ *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkGameCenter(ctx context.Context, _ *apipb.AccountGameCenter) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkGoogle(ctx context.Context, _ *apipb.AccountGoogle) (*emptypb.Empty, error)
- func (s *AuthServer) UnlinkSteam(ctx context.Context, _ *apipb.AccountSteam) (*emptypb.Empty, error)
- func (s *AuthServer) UpdateAccount(ctx context.Context, req *apipb.UpdateAccountRequest) (*emptypb.Empty, error)
- type ChannelServer
- type Config
- type DBNotifier
- type EconomyServer
- type EventServer
- type FriendsServer
- func (s *FriendsServer) AddFriends(ctx context.Context, req *apipb.AddFriendsRequest) (*emptypb.Empty, error)
- func (s *FriendsServer) BlockFriends(ctx context.Context, req *apipb.BlockFriendsRequest) (*emptypb.Empty, error)
- func (s *FriendsServer) DeleteFriends(ctx context.Context, req *apipb.DeleteFriendsRequest) (*emptypb.Empty, error)
- func (s *FriendsServer) ImportFacebookFriends(ctx context.Context, req *apipb.ImportFacebookFriendsRequest) (*emptypb.Empty, error)
- func (s *FriendsServer) ImportSteamFriends(ctx context.Context, req *apipb.ImportSteamFriendsRequest) (*emptypb.Empty, error)
- func (s *FriendsServer) ListFriends(ctx context.Context, req *apipb.ListFriendsRequest) (*apipb.FriendList, error)
- func (s *FriendsServer) ListFriendsOfFriends(ctx context.Context, req *apipb.ListFriendsOfFriendsRequest) (*apipb.FriendsOfFriendsList, error)
- type GroupServer
- func (s *GroupServer) AddGroupUsers(ctx context.Context, req *apipb.AddGroupUsersRequest) (*emptypb.Empty, error)
- func (s *GroupServer) BanGroupUsers(ctx context.Context, req *apipb.BanGroupUsersRequest) (*emptypb.Empty, error)
- func (s *GroupServer) CreateGroup(ctx context.Context, req *apipb.CreateGroupRequest) (*apipb.Group, error)
- func (s *GroupServer) DeleteGroup(ctx context.Context, req *apipb.DeleteGroupRequest) (*emptypb.Empty, error)
- func (s *GroupServer) DemoteGroupUsers(ctx context.Context, req *apipb.DemoteGroupUsersRequest) (*emptypb.Empty, error)
- func (s *GroupServer) JoinGroup(ctx context.Context, req *apipb.JoinGroupRequest) (*emptypb.Empty, error)
- func (s *GroupServer) KickGroupUsers(ctx context.Context, req *apipb.KickGroupUsersRequest) (*emptypb.Empty, error)
- func (s *GroupServer) LeaveGroup(ctx context.Context, req *apipb.LeaveGroupRequest) (*emptypb.Empty, error)
- func (s *GroupServer) ListGroupUsers(ctx context.Context, req *apipb.ListGroupUsersRequest) (*apipb.GroupUserList, error)
- func (s *GroupServer) ListGroups(ctx context.Context, req *apipb.ListGroupsRequest) (*apipb.GroupList, error)
- func (s *GroupServer) ListUserGroups(ctx context.Context, req *apipb.ListUserGroupsRequest) (*apipb.UserGroupList, error)
- func (s *GroupServer) PromoteGroupUsers(ctx context.Context, req *apipb.PromoteGroupUsersRequest) (*emptypb.Empty, error)
- func (s *GroupServer) SetNotifier(n social.FriendNotifier)
- func (s *GroupServer) UpdateGroup(ctx context.Context, req *apipb.UpdateGroupRequest) (*emptypb.Empty, error)
- type IAPServer
- func (s *IAPServer) GetSubscription(ctx context.Context, req *apipb.GetSubscriptionRequest) (*apipb.ValidatedSubscription, error)
- func (s *IAPServer) ListSubscriptions(ctx context.Context, req *apipb.ListSubscriptionsRequest) (*apipb.SubscriptionList, error)
- func (s *IAPServer) SetConfig(cfg economy.IAPConfig)
- func (s *IAPServer) SetHooks(hooks *runtime.HookRegistry)
- func (s *IAPServer) ValidatePurchaseApple(ctx context.Context, req *apipb.ValidatePurchaseAppleRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *IAPServer) ValidatePurchaseFacebookInstant(ctx context.Context, req *apipb.ValidatePurchaseFacebookInstantRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *IAPServer) ValidatePurchaseGoogle(ctx context.Context, req *apipb.ValidatePurchaseGoogleRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *IAPServer) ValidatePurchaseHuawei(ctx context.Context, req *apipb.ValidatePurchaseHuaweiRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *IAPServer) ValidatePurchaseSamsung(ctx context.Context, req *apipb.ValidatePurchaseSamsungRequest) (*apipb.ValidatePurchaseResponse, error)
- func (s *IAPServer) ValidateSubscriptionApple(ctx context.Context, req *apipb.ValidateSubscriptionAppleRequest) (*apipb.ValidateSubscriptionResponse, error)
- func (s *IAPServer) ValidateSubscriptionGoogle(ctx context.Context, req *apipb.ValidateSubscriptionGoogleRequest) (*apipb.ValidateSubscriptionResponse, error)
- type IPTokenBucketRateLimiter
- type LeaderboardServer
- func (s *LeaderboardServer) DeleteLeaderboardRecord(ctx context.Context, req *apipb.DeleteLeaderboardRecordRequest) (*emptypb.Empty, error)
- func (s *LeaderboardServer) ListLeaderboardRecords(ctx context.Context, req *apipb.ListLeaderboardRecordsRequest) (*apipb.LeaderboardRecordList, error)
- func (s *LeaderboardServer) ListLeaderboardRecordsAroundOwner(ctx context.Context, req *apipb.ListLeaderboardRecordsAroundOwnerRequest) (*apipb.LeaderboardRecordList, error)
- func (s *LeaderboardServer) WriteLeaderboardRecord(ctx context.Context, req *apipb.WriteLeaderboardRecordRequest) (*apipb.LeaderboardRecord, error)
- type MatchmakerServer
- type MultiInstanceConfig
- type NotificationServer
- func (s *NotificationServer) DeleteNotifications(ctx context.Context, req *apipb.DeleteNotificationsRequest) (*emptypb.Empty, error)
- func (s *NotificationServer) ListNotifications(ctx context.Context, req *apipb.ListNotificationsRequest) (*apipb.NotificationList, error)
- func (s *NotificationServer) SetHooks(hooks *runtime.HookRegistry)
- type PartyServer
- type RateLimiter
- type RealtimeServer
- type RedisIPRateLimiter
- type RpcServer
- type Server
- func (s *Server) Redis() *redis.Client
- func (s *Server) SessionRegistry() *auth.SessionRegistry
- func (s *Server) SetRuntimeManager(rm *runtime.GoRuntimeManager)
- func (s *Server) SetVMs(luaVM *lua.LState, jsVM *goja.Runtime)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) StartLifecycle(parent context.Context)
- func (s *Server) Stop(ctx context.Context) error
- type SessionIDResolver
- type StorageServer
- func (s *StorageServer) DeleteStorageObjects(ctx context.Context, req *apipb.DeleteStorageObjectsRequest) (*emptypb.Empty, error)
- func (s *StorageServer) ListStorageObjects(ctx context.Context, req *apipb.ListStorageObjectsRequest) (*apipb.StorageObjectList, error)
- func (s *StorageServer) ReadStorageObjects(ctx context.Context, req *apipb.ReadStorageObjectsRequest) (*apipb.StorageObjects, error)
- func (s *StorageServer) WriteStorageObjects(ctx context.Context, req *apipb.WriteStorageObjectsRequest) (*apipb.StorageObjectAcks, error)
- type SystemServer
- type TokenBucket
- type TournamentServer
- func (s *TournamentServer) DeleteTournamentRecord(ctx context.Context, req *apipb.DeleteTournamentRecordRequest) (*emptypb.Empty, error)
- func (s *TournamentServer) JoinTournament(ctx context.Context, req *apipb.JoinTournamentRequest) (*emptypb.Empty, error)
- func (s *TournamentServer) ListTournamentRecords(ctx context.Context, req *apipb.ListTournamentRecordsRequest) (*apipb.TournamentRecordList, error)
- func (s *TournamentServer) ListTournamentRecordsAroundOwner(ctx context.Context, req *apipb.ListTournamentRecordsAroundOwnerRequest) (*apipb.TournamentRecordList, error)
- func (s *TournamentServer) ListTournaments(ctx context.Context, req *apipb.ListTournamentsRequest) (*apipb.TournamentList, error)
- func (s *TournamentServer) WriteTournamentRecord(ctx context.Context, req *apipb.WriteTournamentRecordRequest) (*apipb.LeaderboardRecord, error)
- type UserServer
Constants ¶
const ( UserIDKey contextKey = "user_id" UsernameKey contextKey = "username" RequestIDKey contextKey = "request_id" )
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
AuthMiddleware extracts and validates Bearer JWT token from Authorization header.
func BodyLimitMiddleware ¶
BodyLimitMiddleware restricts request body size.
func CORSMiddleware ¶
CORSMiddleware handles CORS with a configurable origin allowlist. Empty origins or a single "*" entry allows any origin (development default).
func GRPCHookUnaryInterceptor ¶
func GRPCHookUnaryInterceptor(rm *runtime.GoRuntimeManager, luaVM *lua.LState, jsVM *goja.Runtime) grpc.UnaryServerInterceptor
GRPCHookUnaryInterceptor returns a unary interceptor executing before/after hooks.
func GRPCMetricsUnaryInterceptor ¶
func GRPCMetricsUnaryInterceptor() grpc.UnaryServerInterceptor
GRPCMetricsUnaryInterceptor records gRPC request counts for Prometheus.
func HTTPHookMiddleware ¶
func HTTPHookMiddleware(rm *runtime.GoRuntimeManager, luaVM *lua.LState, jsVM *goja.Runtime, next http.HandlerFunc) http.HandlerFunc
HTTPHookMiddleware wraps a REST handler to intercept requests and responses with before/after hooks.
func MetricsMiddleware ¶
MetricsMiddleware records HTTP request counts for Prometheus.
func RateLimitMiddleware ¶
func RateLimitMiddleware(limiter RateLimiter) func(http.Handler) http.Handler
RateLimitMiddleware blocks requests when the rate limit for the client IP is exceeded.
func RequestIDMiddleware ¶
RequestIDMiddleware echoes or generates X-Request-Id.
Types ¶
type ApiServer ¶
type ApiServer struct {
apipb.UnimplementedUltimateGameEngineServer
// contains filtered or unexported fields
}
ApiServer implements apipb.UltimateGameEngineServer by delegating RPC requests to domain sub-servers.
func NewApiServer ¶
func NewApiServer( authServer *AuthServer, storageServer *StorageServer, leaderboardServer *LeaderboardServer, tournamentServer *TournamentServer, friendsServer *FriendsServer, groupServer *GroupServer, matchmakerServer *MatchmakerServer, realtimeServer *RealtimeServer, partyServer *PartyServer, channelServer *ChannelServer, notificationServer *NotificationServer, iapServer *IAPServer, rpcServer *RpcServer, userServer *UserServer, systemServer *SystemServer, eventServer *EventServer, ) *ApiServer
func (*ApiServer) AddFriends ¶
func (*ApiServer) AddGroupUsers ¶
func (*ApiServer) AuthenticateApple ¶
func (*ApiServer) AuthenticateCustom ¶
func (*ApiServer) AuthenticateDevice ¶
func (*ApiServer) AuthenticateEmail ¶
func (*ApiServer) AuthenticateFacebook ¶
func (*ApiServer) AuthenticateFacebookInstantGame ¶
func (*ApiServer) AuthenticateGameCenter ¶
func (*ApiServer) AuthenticateGoogle ¶
func (*ApiServer) AuthenticateSteam ¶
func (*ApiServer) BanGroupUsers ¶
func (*ApiServer) BlockFriends ¶
func (*ApiServer) CreateGroup ¶
func (*ApiServer) DeleteAccount ¶
func (*ApiServer) DeleteFriends ¶
func (*ApiServer) DeleteGroup ¶
func (*ApiServer) DeleteLeaderboardRecord ¶
func (*ApiServer) DeleteNotifications ¶
func (*ApiServer) DeleteStorageObjects ¶
func (*ApiServer) DeleteTournamentRecord ¶
func (*ApiServer) DemoteGroupUsers ¶
func (*ApiServer) GetAccount ¶
func (*ApiServer) GetMatchmakerStats ¶
func (*ApiServer) GetSubscription ¶
func (s *ApiServer) GetSubscription(ctx context.Context, req *apipb.GetSubscriptionRequest) (*apipb.ValidatedSubscription, error)
func (*ApiServer) Healthcheck ¶
func (*ApiServer) ImportFacebookFriends ¶
func (*ApiServer) ImportSteamFriends ¶
func (*ApiServer) JoinTournament ¶
func (*ApiServer) KickGroupUsers ¶
func (*ApiServer) LeaveGroup ¶
func (*ApiServer) LinkCustom ¶
func (*ApiServer) LinkDevice ¶
func (*ApiServer) LinkFacebook ¶
func (*ApiServer) LinkFacebookInstantGame ¶
func (*ApiServer) LinkGameCenter ¶
func (*ApiServer) LinkGoogle ¶
func (*ApiServer) ListChannelMessages ¶
func (s *ApiServer) ListChannelMessages(ctx context.Context, req *apipb.ListChannelMessagesRequest) (*apipb.ChannelMessageList, error)
func (*ApiServer) ListFriends ¶
func (s *ApiServer) ListFriends(ctx context.Context, req *apipb.ListFriendsRequest) (*apipb.FriendList, error)
func (*ApiServer) ListFriendsOfFriends ¶
func (s *ApiServer) ListFriendsOfFriends(ctx context.Context, req *apipb.ListFriendsOfFriendsRequest) (*apipb.FriendsOfFriendsList, error)
func (*ApiServer) ListGroupUsers ¶
func (s *ApiServer) ListGroupUsers(ctx context.Context, req *apipb.ListGroupUsersRequest) (*apipb.GroupUserList, error)
func (*ApiServer) ListGroups ¶
func (*ApiServer) ListLeaderboardRecords ¶
func (s *ApiServer) ListLeaderboardRecords(ctx context.Context, req *apipb.ListLeaderboardRecordsRequest) (*apipb.LeaderboardRecordList, error)
func (*ApiServer) ListLeaderboardRecordsAroundOwner ¶
func (s *ApiServer) ListLeaderboardRecordsAroundOwner(ctx context.Context, req *apipb.ListLeaderboardRecordsAroundOwnerRequest) (*apipb.LeaderboardRecordList, error)
func (*ApiServer) ListMatches ¶
func (*ApiServer) ListNotifications ¶
func (s *ApiServer) ListNotifications(ctx context.Context, req *apipb.ListNotificationsRequest) (*apipb.NotificationList, error)
func (*ApiServer) ListParties ¶
func (*ApiServer) ListStorageObjects ¶
func (s *ApiServer) ListStorageObjects(ctx context.Context, req *apipb.ListStorageObjectsRequest) (*apipb.StorageObjectList, error)
func (*ApiServer) ListSubscriptions ¶
func (s *ApiServer) ListSubscriptions(ctx context.Context, req *apipb.ListSubscriptionsRequest) (*apipb.SubscriptionList, error)
func (*ApiServer) ListTournamentRecords ¶
func (s *ApiServer) ListTournamentRecords(ctx context.Context, req *apipb.ListTournamentRecordsRequest) (*apipb.TournamentRecordList, error)
func (*ApiServer) ListTournamentRecordsAroundOwner ¶
func (s *ApiServer) ListTournamentRecordsAroundOwner(ctx context.Context, req *apipb.ListTournamentRecordsAroundOwnerRequest) (*apipb.TournamentRecordList, error)
func (*ApiServer) ListTournaments ¶
func (s *ApiServer) ListTournaments(ctx context.Context, req *apipb.ListTournamentsRequest) (*apipb.TournamentList, error)
func (*ApiServer) ListUserGroups ¶
func (s *ApiServer) ListUserGroups(ctx context.Context, req *apipb.ListUserGroupsRequest) (*apipb.UserGroupList, error)
func (*ApiServer) PromoteGroupUsers ¶
func (*ApiServer) ReadStorageObjects ¶
func (s *ApiServer) ReadStorageObjects(ctx context.Context, req *apipb.ReadStorageObjectsRequest) (*apipb.StorageObjects, error)
func (*ApiServer) SessionLogout ¶
func (*ApiServer) SessionRefresh ¶
func (*ApiServer) UnlinkApple ¶
func (*ApiServer) UnlinkCustom ¶
func (*ApiServer) UnlinkDevice ¶
func (*ApiServer) UnlinkEmail ¶
func (*ApiServer) UnlinkFacebook ¶
func (*ApiServer) UnlinkFacebookInstantGame ¶
func (*ApiServer) UnlinkGameCenter ¶
func (*ApiServer) UnlinkGoogle ¶
func (*ApiServer) UnlinkSteam ¶
func (*ApiServer) UpdateAccount ¶
func (*ApiServer) UpdateGroup ¶
func (*ApiServer) ValidatePurchaseApple ¶
func (s *ApiServer) ValidatePurchaseApple(ctx context.Context, req *apipb.ValidatePurchaseAppleRequest) (*apipb.ValidatePurchaseResponse, error)
func (*ApiServer) ValidatePurchaseFacebookInstant ¶
func (s *ApiServer) ValidatePurchaseFacebookInstant(ctx context.Context, req *apipb.ValidatePurchaseFacebookInstantRequest) (*apipb.ValidatePurchaseResponse, error)
func (*ApiServer) ValidatePurchaseGoogle ¶
func (s *ApiServer) ValidatePurchaseGoogle(ctx context.Context, req *apipb.ValidatePurchaseGoogleRequest) (*apipb.ValidatePurchaseResponse, error)
func (*ApiServer) ValidatePurchaseHuawei ¶
func (s *ApiServer) ValidatePurchaseHuawei(ctx context.Context, req *apipb.ValidatePurchaseHuaweiRequest) (*apipb.ValidatePurchaseResponse, error)
func (*ApiServer) ValidatePurchaseSamsung ¶
func (s *ApiServer) ValidatePurchaseSamsung(ctx context.Context, req *apipb.ValidatePurchaseSamsungRequest) (*apipb.ValidatePurchaseResponse, error)
func (*ApiServer) ValidateSubscriptionApple ¶
func (s *ApiServer) ValidateSubscriptionApple(ctx context.Context, req *apipb.ValidateSubscriptionAppleRequest) (*apipb.ValidateSubscriptionResponse, error)
func (*ApiServer) ValidateSubscriptionGoogle ¶
func (s *ApiServer) ValidateSubscriptionGoogle(ctx context.Context, req *apipb.ValidateSubscriptionGoogleRequest) (*apipb.ValidateSubscriptionResponse, error)
func (*ApiServer) WriteLeaderboardRecord ¶
func (s *ApiServer) WriteLeaderboardRecord(ctx context.Context, req *apipb.WriteLeaderboardRecordRequest) (*apipb.LeaderboardRecord, error)
func (*ApiServer) WriteStorageObjects ¶
func (s *ApiServer) WriteStorageObjects(ctx context.Context, req *apipb.WriteStorageObjectsRequest) (*apipb.StorageObjectAcks, error)
func (*ApiServer) WriteTournamentRecord ¶
func (s *ApiServer) WriteTournamentRecord(ctx context.Context, req *apipb.WriteTournamentRecordRequest) (*apipb.LeaderboardRecord, error)
type AuthServer ¶
type AuthServer struct {
// contains filtered or unexported fields
}
AuthServer implements authentication, session, and account RPCs.
func NewAuthServer ¶
func NewAuthServer(api *Server) *AuthServer
NewAuthServer wraps the HTTP API server for shared session/DB state.
func (*AuthServer) AuthenticateApple ¶
func (s *AuthServer) AuthenticateApple(ctx context.Context, req *apipb.AuthenticateAppleRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateCustom ¶
func (s *AuthServer) AuthenticateCustom(ctx context.Context, req *apipb.AuthenticateCustomRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateDevice ¶
func (s *AuthServer) AuthenticateDevice(ctx context.Context, req *apipb.AuthenticateDeviceRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateEmail ¶
func (s *AuthServer) AuthenticateEmail(ctx context.Context, req *apipb.AuthenticateEmailRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateFacebook ¶
func (s *AuthServer) AuthenticateFacebook(ctx context.Context, req *apipb.AuthenticateFacebookRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateFacebookInstantGame ¶
func (s *AuthServer) AuthenticateFacebookInstantGame(ctx context.Context, req *apipb.AuthenticateFacebookInstantGameRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateGameCenter ¶
func (s *AuthServer) AuthenticateGameCenter(ctx context.Context, req *apipb.AuthenticateGameCenterRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateGoogle ¶
func (s *AuthServer) AuthenticateGoogle(ctx context.Context, req *apipb.AuthenticateGoogleRequest) (*apipb.Session, error)
func (*AuthServer) AuthenticateSteam ¶
func (s *AuthServer) AuthenticateSteam(ctx context.Context, req *apipb.AuthenticateSteamRequest) (*apipb.Session, error)
func (*AuthServer) DeleteAccount ¶
func (*AuthServer) GetAccount ¶
func (*AuthServer) LinkApple ¶
func (s *AuthServer) LinkApple(ctx context.Context, req *apipb.AccountApple) (*emptypb.Empty, error)
func (*AuthServer) LinkCustom ¶
func (s *AuthServer) LinkCustom(ctx context.Context, req *apipb.AccountCustom) (*emptypb.Empty, error)
func (*AuthServer) LinkDevice ¶
func (s *AuthServer) LinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
func (*AuthServer) LinkEmail ¶
func (s *AuthServer) LinkEmail(ctx context.Context, req *apipb.AccountEmail) (*emptypb.Empty, error)
func (*AuthServer) LinkFacebook ¶
func (s *AuthServer) LinkFacebook(ctx context.Context, req *apipb.LinkFacebookRequest) (*emptypb.Empty, error)
func (*AuthServer) LinkFacebookInstantGame ¶
func (s *AuthServer) LinkFacebookInstantGame(ctx context.Context, req *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
func (*AuthServer) LinkGameCenter ¶
func (s *AuthServer) LinkGameCenter(ctx context.Context, req *apipb.AccountGameCenter) (*emptypb.Empty, error)
func (*AuthServer) LinkGoogle ¶
func (s *AuthServer) LinkGoogle(ctx context.Context, req *apipb.AccountGoogle) (*emptypb.Empty, error)
func (*AuthServer) LinkSteam ¶
func (s *AuthServer) LinkSteam(ctx context.Context, req *apipb.LinkSteamRequest) (*emptypb.Empty, error)
func (*AuthServer) SessionLogout ¶
func (s *AuthServer) SessionLogout(ctx context.Context, req *apipb.SessionLogoutRequest) (*emptypb.Empty, error)
func (*AuthServer) SessionRefresh ¶
func (s *AuthServer) SessionRefresh(ctx context.Context, req *apipb.SessionRefreshRequest) (*apipb.Session, error)
func (*AuthServer) UnlinkApple ¶
func (s *AuthServer) UnlinkApple(ctx context.Context, _ *apipb.AccountApple) (*emptypb.Empty, error)
func (*AuthServer) UnlinkCustom ¶
func (s *AuthServer) UnlinkCustom(ctx context.Context, _ *apipb.AccountCustom) (*emptypb.Empty, error)
func (*AuthServer) UnlinkDevice ¶
func (s *AuthServer) UnlinkDevice(ctx context.Context, req *apipb.AccountDevice) (*emptypb.Empty, error)
func (*AuthServer) UnlinkEmail ¶
func (s *AuthServer) UnlinkEmail(ctx context.Context, _ *apipb.AccountEmail) (*emptypb.Empty, error)
func (*AuthServer) UnlinkFacebook ¶
func (s *AuthServer) UnlinkFacebook(ctx context.Context, _ *apipb.AccountFacebook) (*emptypb.Empty, error)
func (*AuthServer) UnlinkFacebookInstantGame ¶
func (s *AuthServer) UnlinkFacebookInstantGame(ctx context.Context, _ *apipb.AccountFacebookInstantGame) (*emptypb.Empty, error)
func (*AuthServer) UnlinkGameCenter ¶
func (s *AuthServer) UnlinkGameCenter(ctx context.Context, _ *apipb.AccountGameCenter) (*emptypb.Empty, error)
func (*AuthServer) UnlinkGoogle ¶
func (s *AuthServer) UnlinkGoogle(ctx context.Context, _ *apipb.AccountGoogle) (*emptypb.Empty, error)
func (*AuthServer) UnlinkSteam ¶
func (s *AuthServer) UnlinkSteam(ctx context.Context, _ *apipb.AccountSteam) (*emptypb.Empty, error)
func (*AuthServer) UpdateAccount ¶
func (s *AuthServer) UpdateAccount(ctx context.Context, req *apipb.UpdateAccountRequest) (*emptypb.Empty, error)
type ChannelServer ¶
type ChannelServer struct {
// contains filtered or unexported fields
}
ChannelServer implements apipb.ChatServiceServer.
func NewChannelServer ¶
func NewChannelServer(pool *pgxpool.Pool, tm *auth.TokenManager, hooks *runtime.HookRegistry) *ChannelServer
NewChannelServer creates a ChannelServer.
func (*ChannelServer) ListChannelMessages ¶
func (s *ChannelServer) ListChannelMessages(ctx context.Context, req *apipb.ListChannelMessagesRequest) (*apipb.ChannelMessageList, error)
ListChannelMessages lists persistent channel history.
type Config ¶
type Config struct {
HTTPAddr string `json:"http_addr" yaml:"http_addr"`
GRPCAddr string `json:"grpc_addr" yaml:"grpc_addr"`
JWTSecret []byte `json:"jwt_secret" yaml:"jwt_secret"`
JWTExpiry time.Duration `json:"jwt_expiry" yaml:"jwt_expiry"`
RateLimitMax float64 `json:"rate_limit_max" yaml:"rate_limit_max"`
RateLimitRefill float64 `json:"rate_limit_refill" yaml:"rate_limit_refill"`
BodyLimitBytes int64 `json:"body_limit_bytes" yaml:"body_limit_bytes"`
CORSOrigins []string `json:"cors_allowed_origins" yaml:"cors_allowed_origins"`
Version string `json:"version" yaml:"version"`
RPCHTTPKey string `json:"rpc_http_key" yaml:"rpc_http_key"`
RPCTimeoutMs int `json:"rpc_execution_timeout_ms" yaml:"rpc_execution_timeout_ms"`
RPCMaxPayload int `json:"rpc_max_payload_size_bytes" yaml:"rpc_max_payload_size_bytes"`
RuntimePath string `json:"runtime_path" yaml:"runtime_path"`
PresenceMaxSubscriptions int `json:"presence_max_subscriptions_per_user" yaml:"presence_max_subscriptions_per_user"`
PresenceMaxStatusBytes int `json:"presence_max_status_bytes" yaml:"presence_max_status_bytes"`
IAP economy.IAPConfig `json:"iap" yaml:"iap"`
MultiInstance MultiInstanceConfig `json:"multi_instance" yaml:"multi_instance"`
}
Config defines the configuration options for the API server.
type DBNotifier ¶
DBNotifier persists friend notifications via the notification package.
type EconomyServer ¶
type EconomyServer struct {
// contains filtered or unexported fields
}
func NewEconomyServer ¶
func NewEconomyServer(pool *pgxpool.Pool, tm *auth.TokenManager, hooks *runtime.HookRegistry) *EconomyServer
func (*EconomyServer) SetHooks ¶
func (s *EconomyServer) SetHooks(hooks *runtime.HookRegistry)
type EventServer ¶
type EventServer struct {
// contains filtered or unexported fields
}
EventServer implements apipb.EventServiceServer.
func NewEventServer ¶
func NewEventServer(tm *auth.TokenManager, hooks *runtime.HookRegistry, logger runtime.Logger) *EventServer
NewEventServer creates an EventServer.
func (*EventServer) Event ¶
Event accepts client telemetry and dispatches to runtime event handlers.
func (*EventServer) SetHooks ¶
func (s *EventServer) SetHooks(hooks *runtime.HookRegistry)
SetHooks updates the hook registry.
type FriendsServer ¶
type FriendsServer struct {
// contains filtered or unexported fields
}
func NewFriendsServer ¶
func NewFriendsServer(dbPool *pgxpool.Pool, tokenMgr *auth.TokenManager, pt *presence.PresenceTracker) *FriendsServer
func (*FriendsServer) AddFriends ¶
func (s *FriendsServer) AddFriends(ctx context.Context, req *apipb.AddFriendsRequest) (*emptypb.Empty, error)
func (*FriendsServer) BlockFriends ¶
func (s *FriendsServer) BlockFriends(ctx context.Context, req *apipb.BlockFriendsRequest) (*emptypb.Empty, error)
func (*FriendsServer) DeleteFriends ¶
func (s *FriendsServer) DeleteFriends(ctx context.Context, req *apipb.DeleteFriendsRequest) (*emptypb.Empty, error)
func (*FriendsServer) ImportFacebookFriends ¶
func (s *FriendsServer) ImportFacebookFriends(ctx context.Context, req *apipb.ImportFacebookFriendsRequest) (*emptypb.Empty, error)
func (*FriendsServer) ImportSteamFriends ¶
func (s *FriendsServer) ImportSteamFriends(ctx context.Context, req *apipb.ImportSteamFriendsRequest) (*emptypb.Empty, error)
func (*FriendsServer) ListFriends ¶
func (s *FriendsServer) ListFriends(ctx context.Context, req *apipb.ListFriendsRequest) (*apipb.FriendList, error)
func (*FriendsServer) ListFriendsOfFriends ¶
func (s *FriendsServer) ListFriendsOfFriends(ctx context.Context, req *apipb.ListFriendsOfFriendsRequest) (*apipb.FriendsOfFriendsList, error)
type GroupServer ¶
type GroupServer struct {
// contains filtered or unexported fields
}
func NewGroupServer ¶
func NewGroupServer(dbPool *pgxpool.Pool, tokenMgr *auth.TokenManager) *GroupServer
func (*GroupServer) AddGroupUsers ¶
func (s *GroupServer) AddGroupUsers(ctx context.Context, req *apipb.AddGroupUsersRequest) (*emptypb.Empty, error)
func (*GroupServer) BanGroupUsers ¶
func (s *GroupServer) BanGroupUsers(ctx context.Context, req *apipb.BanGroupUsersRequest) (*emptypb.Empty, error)
func (*GroupServer) CreateGroup ¶
func (s *GroupServer) CreateGroup(ctx context.Context, req *apipb.CreateGroupRequest) (*apipb.Group, error)
func (*GroupServer) DeleteGroup ¶
func (s *GroupServer) DeleteGroup(ctx context.Context, req *apipb.DeleteGroupRequest) (*emptypb.Empty, error)
func (*GroupServer) DemoteGroupUsers ¶
func (s *GroupServer) DemoteGroupUsers(ctx context.Context, req *apipb.DemoteGroupUsersRequest) (*emptypb.Empty, error)
func (*GroupServer) JoinGroup ¶
func (s *GroupServer) JoinGroup(ctx context.Context, req *apipb.JoinGroupRequest) (*emptypb.Empty, error)
func (*GroupServer) KickGroupUsers ¶
func (s *GroupServer) KickGroupUsers(ctx context.Context, req *apipb.KickGroupUsersRequest) (*emptypb.Empty, error)
func (*GroupServer) LeaveGroup ¶
func (s *GroupServer) LeaveGroup(ctx context.Context, req *apipb.LeaveGroupRequest) (*emptypb.Empty, error)
func (*GroupServer) ListGroupUsers ¶
func (s *GroupServer) ListGroupUsers(ctx context.Context, req *apipb.ListGroupUsersRequest) (*apipb.GroupUserList, error)
func (*GroupServer) ListGroups ¶
func (s *GroupServer) ListGroups(ctx context.Context, req *apipb.ListGroupsRequest) (*apipb.GroupList, error)
func (*GroupServer) ListUserGroups ¶
func (s *GroupServer) ListUserGroups(ctx context.Context, req *apipb.ListUserGroupsRequest) (*apipb.UserGroupList, error)
func (*GroupServer) PromoteGroupUsers ¶
func (s *GroupServer) PromoteGroupUsers(ctx context.Context, req *apipb.PromoteGroupUsersRequest) (*emptypb.Empty, error)
func (*GroupServer) SetNotifier ¶
func (s *GroupServer) SetNotifier(n social.FriendNotifier)
SetNotifier configures group notification delivery.
func (*GroupServer) UpdateGroup ¶
func (s *GroupServer) UpdateGroup(ctx context.Context, req *apipb.UpdateGroupRequest) (*emptypb.Empty, error)
type IAPServer ¶
type IAPServer struct {
// contains filtered or unexported fields
}
IAPServer implements apipb.IAPServiceServer.
func NewIAPServer ¶
func NewIAPServer(pool *pgxpool.Pool, tm *auth.TokenManager, hooks *runtime.HookRegistry, cfg economy.IAPConfig) *IAPServer
func (*IAPServer) GetSubscription ¶
func (s *IAPServer) GetSubscription(ctx context.Context, req *apipb.GetSubscriptionRequest) (*apipb.ValidatedSubscription, error)
func (*IAPServer) ListSubscriptions ¶
func (s *IAPServer) ListSubscriptions(ctx context.Context, req *apipb.ListSubscriptionsRequest) (*apipb.SubscriptionList, error)
func (*IAPServer) SetHooks ¶
func (s *IAPServer) SetHooks(hooks *runtime.HookRegistry)
func (*IAPServer) ValidatePurchaseApple ¶
func (s *IAPServer) ValidatePurchaseApple(ctx context.Context, req *apipb.ValidatePurchaseAppleRequest) (*apipb.ValidatePurchaseResponse, error)
func (*IAPServer) ValidatePurchaseFacebookInstant ¶
func (s *IAPServer) ValidatePurchaseFacebookInstant(ctx context.Context, req *apipb.ValidatePurchaseFacebookInstantRequest) (*apipb.ValidatePurchaseResponse, error)
func (*IAPServer) ValidatePurchaseGoogle ¶
func (s *IAPServer) ValidatePurchaseGoogle(ctx context.Context, req *apipb.ValidatePurchaseGoogleRequest) (*apipb.ValidatePurchaseResponse, error)
func (*IAPServer) ValidatePurchaseHuawei ¶
func (s *IAPServer) ValidatePurchaseHuawei(ctx context.Context, req *apipb.ValidatePurchaseHuaweiRequest) (*apipb.ValidatePurchaseResponse, error)
func (*IAPServer) ValidatePurchaseSamsung ¶
func (s *IAPServer) ValidatePurchaseSamsung(ctx context.Context, req *apipb.ValidatePurchaseSamsungRequest) (*apipb.ValidatePurchaseResponse, error)
func (*IAPServer) ValidateSubscriptionApple ¶
func (s *IAPServer) ValidateSubscriptionApple(ctx context.Context, req *apipb.ValidateSubscriptionAppleRequest) (*apipb.ValidateSubscriptionResponse, error)
func (*IAPServer) ValidateSubscriptionGoogle ¶
func (s *IAPServer) ValidateSubscriptionGoogle(ctx context.Context, req *apipb.ValidateSubscriptionGoogleRequest) (*apipb.ValidateSubscriptionResponse, error)
type IPTokenBucketRateLimiter ¶
type IPTokenBucketRateLimiter struct {
// contains filtered or unexported fields
}
IPTokenBucketRateLimiter manages a pool of IP-based rate limiters.
func NewIPRateLimiter ¶
func NewIPRateLimiter(maxTokens, refillRate float64) *IPTokenBucketRateLimiter
NewIPRateLimiter creates a new IPRateLimiter.
func (*IPTokenBucketRateLimiter) Allow ¶
func (lim *IPTokenBucketRateLimiter) Allow(key string) bool
Allow checks if a request from a specific key is allowed.
func (*IPTokenBucketRateLimiter) AllowWithInfo ¶
AllowWithInfo implements RateLimiter.
func (*IPTokenBucketRateLimiter) GetLimiter ¶
func (lim *IPTokenBucketRateLimiter) GetLimiter(key string) *TokenBucket
GetLimiter retrieves or creates a rate limiter for a specific key (e.g. IP address or userID).
func (*IPTokenBucketRateLimiter) MaxTokens ¶
func (lim *IPTokenBucketRateLimiter) MaxTokens() float64
MaxTokens returns the configured bucket capacity.
type LeaderboardServer ¶
type LeaderboardServer struct {
// contains filtered or unexported fields
}
func NewLeaderboardServer ¶
func NewLeaderboardServer(dbPool *pgxpool.Pool, rdb *redis.Client, tokenMgr *auth.TokenManager) *LeaderboardServer
func (*LeaderboardServer) DeleteLeaderboardRecord ¶
func (s *LeaderboardServer) DeleteLeaderboardRecord(ctx context.Context, req *apipb.DeleteLeaderboardRecordRequest) (*emptypb.Empty, error)
func (*LeaderboardServer) ListLeaderboardRecords ¶
func (s *LeaderboardServer) ListLeaderboardRecords(ctx context.Context, req *apipb.ListLeaderboardRecordsRequest) (*apipb.LeaderboardRecordList, error)
func (*LeaderboardServer) ListLeaderboardRecordsAroundOwner ¶
func (s *LeaderboardServer) ListLeaderboardRecordsAroundOwner(ctx context.Context, req *apipb.ListLeaderboardRecordsAroundOwnerRequest) (*apipb.LeaderboardRecordList, error)
func (*LeaderboardServer) WriteLeaderboardRecord ¶
func (s *LeaderboardServer) WriteLeaderboardRecord(ctx context.Context, req *apipb.WriteLeaderboardRecordRequest) (*apipb.LeaderboardRecord, error)
type MatchmakerServer ¶
type MatchmakerServer struct {
// contains filtered or unexported fields
}
func NewMatchmakerServer ¶
func NewMatchmakerServer(mm *matchmaker.Matchmaker, tm *auth.TokenManager, resolver SessionIDResolver) *MatchmakerServer
func (*MatchmakerServer) GetMatchmakerStats ¶
func (s *MatchmakerServer) GetMatchmakerStats(ctx context.Context, _ *emptypb.Empty) (*apipb.MatchmakerStats, error)
GetMatchmakerStats returns aggregate matchmaker statistics (reference-compatible).
type MultiInstanceConfig ¶ added in v1.1.1
type NotificationServer ¶
type NotificationServer struct {
// contains filtered or unexported fields
}
NotificationServer implements apipb.NotificationServiceServer.
func NewNotificationServer ¶
func NewNotificationServer(pool *pgxpool.Pool, tm *auth.TokenManager, hooks *runtime.HookRegistry) *NotificationServer
NewNotificationServer creates a NotificationServer.
func (*NotificationServer) DeleteNotifications ¶
func (s *NotificationServer) DeleteNotifications(ctx context.Context, req *apipb.DeleteNotificationsRequest) (*emptypb.Empty, error)
func (*NotificationServer) ListNotifications ¶
func (s *NotificationServer) ListNotifications(ctx context.Context, req *apipb.ListNotificationsRequest) (*apipb.NotificationList, error)
func (*NotificationServer) SetHooks ¶
func (s *NotificationServer) SetHooks(hooks *runtime.HookRegistry)
SetHooks attaches Before/After List/Delete hook registry.
type PartyServer ¶
type PartyServer struct {
// contains filtered or unexported fields
}
PartyServer implements apipb.PartyServiceServer.
func NewPartyServer ¶
func NewPartyServer(reg *party.Registry, tm *auth.TokenManager) *PartyServer
NewPartyServer creates a PartyServer.
func (*PartyServer) ListParties ¶
func (s *PartyServer) ListParties(ctx context.Context, req *apipb.ListPartiesRequest) (*apipb.PartyList, error)
ListParties lists discoverable parties.
type RateLimiter ¶
type RateLimiter interface {
MaxTokens() float64
AllowWithInfo(key string) (allowed bool, remaining float64, resetAt time.Time)
}
RateLimiter is implemented by in-memory and Redis-backed API rate limiters.
type RealtimeServer ¶
type RealtimeServer struct {
// contains filtered or unexported fields
}
RealtimeServer implements apipb.RealtimeServiceServer.
func NewRealtimeServer ¶
func NewRealtimeServer(logger *zap.Logger, matchRouter *match.Router, rdb *redis.Client, tm *auth.TokenManager) *RealtimeServer
NewRealtimeServer creates a new RealtimeServer instance.
func (*RealtimeServer) ListMatches ¶
func (s *RealtimeServer) ListMatches(ctx context.Context, req *apipb.ListMatchesRequest) (*apipb.MatchList, error)
ListMatches queries active matches.
type RedisIPRateLimiter ¶
type RedisIPRateLimiter struct {
// contains filtered or unexported fields
}
Falls back to in-memory token bucket when Redis is unavailable.
func NewRedisIPRateLimiter ¶
func NewRedisIPRateLimiter(rdb *redis.Client, maxTokens, refillRate float64, window time.Duration) *RedisIPRateLimiter
NewRedisIPRateLimiter creates a cluster-aware rate limiter with local fallback.
func (*RedisIPRateLimiter) Allow ¶
func (lim *RedisIPRateLimiter) Allow(key string) bool
Allow checks if a request is allowed for the key.
func (*RedisIPRateLimiter) AllowWithInfo ¶
RedisIPRateLimiter applies a fixed-window counter per key using Redis INCR. AllowWithInfo returns allowance, remaining tokens, and reset time.
func (*RedisIPRateLimiter) MaxTokens ¶
func (lim *RedisIPRateLimiter) MaxTokens() float64
MaxTokens returns configured bucket capacity.
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
RpcServer implements apipb.RpcServiceServer.
func NewRpcServer ¶
func NewRpcServer(pool *pgxpool.Pool, tm *auth.TokenManager, rm *runtime.GoRuntimeManager, cfg runtime.RPCConfig) *RpcServer
func (*RpcServer) SetRuntime ¶
func (s *RpcServer) SetRuntime(rm *runtime.GoRuntimeManager)
type Server ¶
type Server struct {
SocketRegistry *socket.ConnectionRegistry
SocketGateway *socket.GatewayHandler
MatchRouter *match.Router
Matchmaker *matchmaker.Matchmaker
PartyRegistry *party.Registry
RuntimeManager *runtime.GoRuntimeManager
LuaVM *lua.LState
JSVM *goja.Runtime
TournamentScheduler *tournament.TournamentScheduler
// contains filtered or unexported fields
}
Server handles HTTP and gRPC network interfaces.
func (*Server) SessionRegistry ¶
func (s *Server) SessionRegistry() *auth.SessionRegistry
SessionRegistry exposes the session registry for console ban revocation.
func (*Server) SetRuntimeManager ¶
func (s *Server) SetRuntimeManager(rm *runtime.GoRuntimeManager)
SetRuntimeManager configures the runtime manager for hook interceptors.
func (*Server) StartLifecycle ¶
StartLifecycle starts leaderboard invalidation listener, rank trimmer, and tournament scheduler.
type SessionIDResolver ¶
type StorageServer ¶
type StorageServer struct {
// contains filtered or unexported fields
}
func NewStorageServer ¶
func NewStorageServer(dbPool *pgxpool.Pool, tokenMgr *auth.TokenManager) *StorageServer
func (*StorageServer) DeleteStorageObjects ¶
func (s *StorageServer) DeleteStorageObjects(ctx context.Context, req *apipb.DeleteStorageObjectsRequest) (*emptypb.Empty, error)
func (*StorageServer) ListStorageObjects ¶
func (s *StorageServer) ListStorageObjects(ctx context.Context, req *apipb.ListStorageObjectsRequest) (*apipb.StorageObjectList, error)
func (*StorageServer) ReadStorageObjects ¶
func (s *StorageServer) ReadStorageObjects(ctx context.Context, req *apipb.ReadStorageObjectsRequest) (*apipb.StorageObjects, error)
func (*StorageServer) WriteStorageObjects ¶
func (s *StorageServer) WriteStorageObjects(ctx context.Context, req *apipb.WriteStorageObjectsRequest) (*apipb.StorageObjectAcks, error)
type SystemServer ¶
type SystemServer struct{}
SystemServer implements apipb.SystemServiceServer.
func (*SystemServer) Healthcheck ¶
Healthcheck returns OK when the process is serving.
type TokenBucket ¶
type TokenBucket struct {
// contains filtered or unexported fields
}
TokenBucket implements a rate limiter using the Token Bucket algorithm.
func NewTokenBucket ¶
func NewTokenBucket(maxTokens, refillRate float64) *TokenBucket
NewTokenBucket creates a new TokenBucket rate limiter.
func (*TokenBucket) Allow ¶
func (tb *TokenBucket) Allow() bool
Allow checks if a request is allowed, refilling tokens and consuming one if available.
func (*TokenBucket) AllowWithInfo ¶
func (tb *TokenBucket) AllowWithInfo() (allowed bool, remaining float64, resetAt time.Time)
AllowWithInfo consumes one token when available and returns remaining tokens and reset time. Reset is when the bucket is expected to regain at least one token if currently empty.
type TournamentServer ¶
type TournamentServer struct {
// contains filtered or unexported fields
}
func NewTournamentServer ¶
func NewTournamentServer(dbPool *pgxpool.Pool, rdb *redis.Client, tokenMgr *auth.TokenManager) *TournamentServer
func (*TournamentServer) DeleteTournamentRecord ¶
func (s *TournamentServer) DeleteTournamentRecord(ctx context.Context, req *apipb.DeleteTournamentRecordRequest) (*emptypb.Empty, error)
func (*TournamentServer) JoinTournament ¶
func (s *TournamentServer) JoinTournament(ctx context.Context, req *apipb.JoinTournamentRequest) (*emptypb.Empty, error)
func (*TournamentServer) ListTournamentRecords ¶
func (s *TournamentServer) ListTournamentRecords(ctx context.Context, req *apipb.ListTournamentRecordsRequest) (*apipb.TournamentRecordList, error)
func (*TournamentServer) ListTournamentRecordsAroundOwner ¶
func (s *TournamentServer) ListTournamentRecordsAroundOwner(ctx context.Context, req *apipb.ListTournamentRecordsAroundOwnerRequest) (*apipb.TournamentRecordList, error)
func (*TournamentServer) ListTournaments ¶
func (s *TournamentServer) ListTournaments(ctx context.Context, req *apipb.ListTournamentsRequest) (*apipb.TournamentList, error)
func (*TournamentServer) WriteTournamentRecord ¶
func (s *TournamentServer) WriteTournamentRecord(ctx context.Context, req *apipb.WriteTournamentRecordRequest) (*apipb.LeaderboardRecord, error)
type UserServer ¶
type UserServer struct {
// contains filtered or unexported fields
}
UserServer implements apipb.UserServiceServer.
func NewUserServer ¶
func NewUserServer(pool *pgxpool.Pool, tm *auth.TokenManager) *UserServer
NewUserServer creates a UserServer.
func (*UserServer) GetUsers ¶
func (s *UserServer) GetUsers(ctx context.Context, req *apipb.GetUsersRequest) (*apipb.Users, error)
GetUsers returns public user profiles by id, username, or facebook id.
Source Files
¶
- account_auth.go
- api_server.go
- auth_server.go
- channel_server.go
- economy_server.go
- event_server.go
- friends_server.go
- group_server.go
- iap_server.go
- interceptors.go
- leaderboard_server.go
- matchmaker_envelope.go
- matchmaker_server.go
- middleware.go
- notification_server.go
- party_server.go
- rate_limiter.go
- rate_limiter_redis.go
- realtime_server.go
- rpc_server.go
- server.go
- storage_server.go
- system_server.go
- tournament_server.go
- user_server.go