Documentation
¶
Index ¶
- func DeleteAllData(ctx context.Context, pool *pgxpool.Pool) error
- func DeleteStorage(ctx context.Context, pool *pgxpool.Pool) error
- func ImportAccount(ctx context.Context, pool *pgxpool.Pool, data *AccountExport) error
- func ImportStorageObjects(ctx context.Context, pool *pgxpool.Pool, objects []*storage.StorageObject) error
- func ValidateTOTP(secret []byte, code string) bool
- type AccountExport
- type AuditLogEntry
- type ConsoleClaims
- type GRPCConsole
- func (g *GRPCConsole) DeleteAllData(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (g *GRPCConsole) DeleteStorage(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (g *GRPCConsole) GetStatus(ctx context.Context, _ *emptypb.Empty) (*consolepb.Status, error)
- func (g *GRPCConsole) ImportAccount(ctx context.Context, in *consolepb.AccountImport) (*emptypb.Empty, error)
- func (g *GRPCConsole) ImportAccountFull(ctx context.Context, in *consolepb.AccountImport) (*emptypb.Empty, error)
- func (g *GRPCConsole) ImportStorage(ctx context.Context, in *consolepb.StorageImport) (*emptypb.Empty, error)
- func (g *GRPCConsole) SatoriListTemplates(ctx context.Context, in *consolepb.SatoriListTemplatesRequest) (*consolepb.SatoriListTemplatesResponse, error)
- func (g *GRPCConsole) SatoriSendDirectMessage(ctx context.Context, in *consolepb.SatoriSendDirectMessageRequest) (*consolepb.SatoriSendDirectMessageResponse, error)
- type IAPNotificationDeps
- type Logger
- type MatchLister
- type MatchStater
- type RPCDispatcher
- type Server
- func (s *Server) Close()
- func (s *Server) SetIAPNotificationDeps(d IAPNotificationDeps)
- func (s *Server) SetMatchDeps(lister MatchLister, stater MatchStater)
- func (s *Server) SetRPCDispatcher(d RPCDispatcher)
- func (s *Server) SetRuntimeRegistry(reg *runtime.HookRegistry)
- func (s *Server) SetSatoriClient(c *satori.Client)
- func (s *Server) SetSessionRevoker(r SessionRevoker)
- func (s *Server) SetStatusProvider(p StatusProvider)
- func (s *Server) Start(addr string) error
- type SessionRevoker
- type StatusProvider
- type StorageExportObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAllData ¶
DeleteAllData truncates application tables and re-seeds the system user.
func DeleteStorage ¶
DeleteStorage truncates the storage table (wipe-all).
func ImportAccount ¶
ImportAccount creates or replaces an account from export data.
func ImportStorageObjects ¶
func ImportStorageObjects(ctx context.Context, pool *pgxpool.Pool, objects []*storage.StorageObject) error
ImportStorageObjects writes a batch of storage objects authoritatively.
func ValidateTOTP ¶
ValidateTOTP validates a 6-digit TOTP code against a secret key for the current time. It allows a time window of +/- 1 time step (30 seconds) to account for clock drift.
Types ¶
type AccountExport ¶
type AccountExport struct {
UserID string `json:"user_id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
Metadata map[string]interface{} `json:"metadata"`
Wallet map[string]int64 `json:"wallet"`
Storage []StorageExportObject `json:"storage"`
}
AccountExport is the portable account import blob.
type AuditLogEntry ¶
type AuditLogEntry struct {
ID string
ConsoleUserID string
ConsoleUsername string
Email string
Action string
Resource string
Message string
Metadata map[string]any
CreateTime time.Time
}
AuditLogEntry is the queue payload for console_audit_log.
type ConsoleClaims ¶
type ConsoleClaims struct {
UserID string `json:"user_id"`
Username string `json:"username"`
Email string `json:"email"`
ACL map[string]interface{} `json:"acl"` // legacy JSON flags (compat)
ACLBitmap string `json:"acl_bitmap"` // reference-aligned bitmap
jwt.RegisteredClaims
}
ConsoleClaims defines the JWT claims for authenticated console operators.
func (*ConsoleClaims) Permission ¶
func (c *ConsoleClaims) Permission() acl.Permission
type GRPCConsole ¶
type GRPCConsole struct {
consolepb.UnimplementedConsoleServer
Server *Server
}
GRPCConsole implements consolepb.ConsoleServer. HTTP /v2/console is the primary gateway-equivalent surface; gRPC exposes core status and is extended over time.
func NewGRPCConsole ¶
func NewGRPCConsole(s *Server) *GRPCConsole
func (*GRPCConsole) DeleteAllData ¶
func (*GRPCConsole) DeleteStorage ¶
func (*GRPCConsole) ImportAccount ¶
func (g *GRPCConsole) ImportAccount(ctx context.Context, in *consolepb.AccountImport) (*emptypb.Empty, error)
func (*GRPCConsole) ImportAccountFull ¶
func (g *GRPCConsole) ImportAccountFull(ctx context.Context, in *consolepb.AccountImport) (*emptypb.Empty, error)
func (*GRPCConsole) ImportStorage ¶
func (g *GRPCConsole) ImportStorage(ctx context.Context, in *consolepb.StorageImport) (*emptypb.Empty, error)
func (*GRPCConsole) SatoriListTemplates ¶
func (g *GRPCConsole) SatoriListTemplates(ctx context.Context, in *consolepb.SatoriListTemplatesRequest) (*consolepb.SatoriListTemplatesResponse, error)
func (*GRPCConsole) SatoriSendDirectMessage ¶
func (g *GRPCConsole) SatoriSendDirectMessage(ctx context.Context, in *consolepb.SatoriSendDirectMessageRequest) (*consolepb.SatoriSendDirectMessageResponse, error)
type IAPNotificationDeps ¶
type IAPNotificationDeps struct {
AppleEndpointID string
GoogleEndpointID string
Registry *runtime.HookRegistry
NK runtime.RuntimeModule
Logger runtime.Logger
}
IAPNotificationDeps wires store RTDN endpoints on the console mux.
type MatchLister ¶
type MatchLister interface {
ListMatches() []map[string]interface{}
}
MatchLister lists active matches for console status/ops.
type MatchStater ¶
MatchStater returns match state JSON for a match id.
type RPCDispatcher ¶
type RPCDispatcher interface {
DispatchRPC(ctx context.Context, id, payload string, userID, username string) (string, error)
}
RPCDispatcher invokes a runtime RPC as an admin.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server encapsulates the Console Admin HTTP server.
func (*Server) Close ¶
func (s *Server) Close()
Close gracefully terminates HTTP/gRPC servers and async workers.
func (*Server) SetIAPNotificationDeps ¶
func (s *Server) SetIAPNotificationDeps(d IAPNotificationDeps)
SetIAPNotificationDeps configures Apple/Google notification webhook routes.
func (*Server) SetMatchDeps ¶
func (s *Server) SetMatchDeps(lister MatchLister, stater MatchStater)
SetMatchDeps wires match list/state helpers.
func (*Server) SetRPCDispatcher ¶
func (s *Server) SetRPCDispatcher(d RPCDispatcher)
SetRPCDispatcher wires CallRpc.
func (*Server) SetRuntimeRegistry ¶
func (s *Server) SetRuntimeRegistry(reg *runtime.HookRegistry)
SetRuntimeRegistry enables mounting RegisterConsoleHttp handlers on the console mux.
func (*Server) SetSatoriClient ¶
SetSatoriClient wires Satori console RPCs.
func (*Server) SetSessionRevoker ¶
func (s *Server) SetSessionRevoker(r SessionRevoker)
SetSessionRevoker configures session revocation on ban/delete.
func (*Server) SetStatusProvider ¶
func (s *Server) SetStatusProvider(p StatusProvider)
SetStatusProvider wires GET /console/api/status.
type SessionRevoker ¶
type SessionRevoker interface {
RevokeAllSessions(userID string)
}
SessionRevoker invalidates player sessions (e.g. on ban).
type StatusProvider ¶
type StatusProvider interface {
ConsoleStatus() map[string]interface{}
}
StatusProvider supplies node status metrics.