Documentation
¶
Index ¶
- Constants
- Variables
- type AdminOptions
- type AdminServer
- type DataOptions
- type GameOptions
- type GameServer
- type LoginOptions
- type LoginServer
- type MessageOptions
- type MessageServer
- type Options
- func (options *Options) ShouldConfigureAdmin(newOpts Options) bool
- func (options *Options) ShouldConfigureGame(newOpts Options) bool
- func (options *Options) ShouldConfigureLogin(newOpts Options) bool
- func (options *Options) ShouldConfigureMessage(newOpts Options) bool
- func (options *Options) ShouldConfigureQAAuth(newOpts Options) bool
- func (options *Options) ShouldConfigureTopology(newOpts Options) bool
- func (options *Options) ShouldConfigureWeb(newOpts Options) bool
- func (options *Options) ShouldRedetectPangyaKey(newOpts Options) bool
- type QAAuthOptions
- type QAAuthServer
- type RugburnOptions
- type RugburnPatcher
- type Server
- type Service
- func (s *Service) Configure(spawn ServiceSpawnFunc) error
- func (s *Service) ConfigureContext(shutdownCtx context.Context, spawn ServiceSpawnFunc) error
- func (s *Service) Running() bool
- func (s *Service) SetShutdownFunc(shutdown ServiceShutdownFunc)
- func (s *Service) Start() error
- func (s *Service) Stop() error
- func (s *Service) StopContext(shutdownCtx context.Context) error
- type ServiceShutdownFunc
- type ServiceSpawnFunc
- type TopologyServer
- type TopologyServerOptions
- type WebOptions
- type WebServer
Constants ¶
const ShutdownTimeout = 10 * time.Second
Variables ¶
var ErrServiceNotConfigured = errors.New("service is not configured") // +checklocksignore
var ErrServiceRunning = errors.New("service is already running") // +checklocksignore
var ErrServiceStopped = errors.New("service is already stopped") // +checklocksignore
var ErrStopping = errors.New("stopping service") // +checklocksignore
Functions ¶
This section is empty.
Types ¶
type AdminOptions ¶
type AdminServer ¶
type AdminServer struct {
// contains filtered or unexported fields
}
func NewAdmin ¶
func NewAdmin(ctx context.Context) *AdminServer
func (*AdminServer) Configure ¶
func (w *AdminServer) Configure(opts AdminOptions) error
func (*AdminServer) Running ¶
func (w *AdminServer) Running() bool
func (*AdminServer) Start ¶
func (w *AdminServer) Start() error
func (*AdminServer) Stop ¶
func (w *AdminServer) Stop() error
type DataOptions ¶
type DataOptions struct {
DatabaseURI string `json:"URI"`
}
type GameOptions ¶
type GameServer ¶
type GameServer struct {
// contains filtered or unexported fields
}
func NewGameServer ¶
func NewGameServer(ctx context.Context) *GameServer
func (*GameServer) Configure ¶
func (g *GameServer) Configure(opts GameOptions) error
func (*GameServer) Running ¶
func (g *GameServer) Running() bool
func (*GameServer) Start ¶
func (g *GameServer) Start() error
func (*GameServer) Stop ¶
func (g *GameServer) Stop() error
type LoginOptions ¶
type LoginOptions struct {
Logger zerolog.Logger
Addr string
TopologyClient topologypbconnect.TopologyServiceClient
AccountsService *accounts.Service
}
type LoginServer ¶
type LoginServer struct {
// contains filtered or unexported fields
}
func NewLoginServer ¶
func NewLoginServer(ctx context.Context) *LoginServer
func (*LoginServer) Configure ¶
func (l *LoginServer) Configure(opts LoginOptions) error
func (*LoginServer) Running ¶
func (l *LoginServer) Running() bool
func (*LoginServer) Start ¶
func (l *LoginServer) Start() error
func (*LoginServer) Stop ¶
func (l *LoginServer) Stop() error
type MessageOptions ¶
type MessageOptions struct {
Logger zerolog.Logger
Addr string
TopologyClient topologypbconnect.TopologyServiceClient
AccountsService *accounts.Service
}
type MessageServer ¶
type MessageServer struct {
// contains filtered or unexported fields
}
func NewMessageServer ¶
func NewMessageServer(ctx context.Context) *MessageServer
func (*MessageServer) Configure ¶
func (m *MessageServer) Configure(opts MessageOptions) error
func (*MessageServer) Running ¶
func (m *MessageServer) Running() bool
func (*MessageServer) Start ¶
func (m *MessageServer) Start() error
func (*MessageServer) Stop ¶
func (m *MessageServer) Stop() error
type Options ¶
type Options struct {
WebAddr string `json:"WebAddr"`
AdminAddr string `json:"AdminAddr"`
QAAuthAddr string `json:"QAAuthAddr"`
LoginAddr string `json:"LoginAddr"`
GameAddr string `json:"GameAddr"`
MessageAddr string `json:"MessageAddr"`
ServerIP string `json:"ServerIP"`
GameServerName string `json:"GameServerName"`
GameChannelName string `json:"GameChannelName"`
PangyaRegion string `json:"PangyaRegion"`
PangyaDir string `json:"PangyaDir"`
PangyaIFF string `json:"PangyaIFF"`
}
func (*Options) ShouldConfigureAdmin ¶
ShouldConfigureAdmin returns true if the options changed require the admin server to be re-configured.
func (*Options) ShouldConfigureGame ¶
ShouldConfigureGame returns true if the options changed require the game server to be re-configured.
func (*Options) ShouldConfigureLogin ¶
ShouldConfigureLogin returns true if the options changed require the login server to be re-configured.
func (*Options) ShouldConfigureMessage ¶
ShouldConfigureMessage returns true if the options changed require the message server to be re-configured.
func (*Options) ShouldConfigureQAAuth ¶
ShouldConfigureQAAuth returns true if the options changed require the QA auth server to be re-configured.
func (*Options) ShouldConfigureTopology ¶
ShouldConfigureMessage returns true if the options changed require the message server to be re-configured.
func (*Options) ShouldConfigureWeb ¶
ShouldConfigureWeb returns true if the options changed require the webserver to be re-configured.
func (*Options) ShouldRedetectPangyaKey ¶
ShouldRedetectPangyaKey returns true if the options changed require the PangYa key to be re-detected.
type QAAuthOptions ¶
type QAAuthServer ¶
type QAAuthServer struct {
// contains filtered or unexported fields
}
func NewQAAuth ¶
func NewQAAuth(ctx context.Context) *QAAuthServer
func (*QAAuthServer) Configure ¶
func (q *QAAuthServer) Configure(opts QAAuthOptions) error
func (*QAAuthServer) Running ¶
func (q *QAAuthServer) Running() bool
func (*QAAuthServer) Start ¶
func (q *QAAuthServer) Start() error
func (*QAAuthServer) Stop ¶
func (q *QAAuthServer) Stop() error
type RugburnOptions ¶
type RugburnPatcher ¶
type RugburnPatcher struct {
// contains filtered or unexported fields
}
func NewRugburnPatcher ¶
func NewRugburnPatcher() *RugburnPatcher
func (*RugburnPatcher) Configure ¶
func (p *RugburnPatcher) Configure(opts RugburnOptions)
func (*RugburnPatcher) HaveOriginal ¶
func (p *RugburnPatcher) HaveOriginal() bool
func (*RugburnPatcher) Patch ¶
func (p *RugburnPatcher) Patch() error
func (*RugburnPatcher) RugburnVersion ¶
func (p *RugburnPatcher) RugburnVersion() (string, error)
func (*RugburnPatcher) Unpatch ¶
func (p *RugburnPatcher) Unpatch() error
type Server ¶
type Server struct {
// Network services
// +checklocks:mu
Topology *TopologyServer
// +checklocks:mu
Web *WebServer
// +checklocks:mu
Admin *AdminServer
// +checklocks:mu
Login *LoginServer
// +checklocks:mu
Game *GameServer
// +checklocks:mu
Message *MessageServer
// +checklocks:mu
QAAuth *QAAuthServer
// Misc
// +checklocks:mu
Rugburn *RugburnPatcher
// contains filtered or unexported fields
}
func (*Server) ConfigureDatabase ¶
func (server *Server) ConfigureDatabase(opts DataOptions) error
ConfigureDatabase configures the database, including running pending migrations. If the services are already configured, it will also re-run service configuration with the last configuration.
func (*Server) ConfigureServices ¶
ConfigureServices reconfigures services. You must successfully configure the database before running this.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Configure ¶
func (s *Service) Configure(spawn ServiceSpawnFunc) error
func (*Service) ConfigureContext ¶
func (s *Service) ConfigureContext(shutdownCtx context.Context, spawn ServiceSpawnFunc) error
func (*Service) SetShutdownFunc ¶
func (s *Service) SetShutdownFunc(shutdown ServiceShutdownFunc)
type ServiceShutdownFunc ¶
type ServiceSpawnFunc ¶
type TopologyServer ¶
type TopologyServer struct {
// contains filtered or unexported fields
}
func NewLocalTopology ¶
func NewLocalTopology(ctx context.Context) *TopologyServer
func (*TopologyServer) Client ¶
func (t *TopologyServer) Client() topologypbconnect.TopologyServiceClient
func (*TopologyServer) Configure ¶
func (t *TopologyServer) Configure(opts TopologyServerOptions) error
func (*TopologyServer) Running ¶
func (t *TopologyServer) Running() bool
func (*TopologyServer) Start ¶
func (t *TopologyServer) Start() error
func (*TopologyServer) Stop ¶
func (t *TopologyServer) Stop() error