handler

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheKeyWorlds           = "worlds"
	CacheKeyMCVersions       = "mcversions"
	CacheKeySystemInfoPrefix = "system-info"
)
View Source
const ScopeName = "github.com/kofuk/premises/controlpanel/internal/handler"

Variables

This section is empty.

Functions

This section is empty.

Types

type GameServer

type GameServer struct {
	// contains filtered or unexported fields
}

func NewGameServer

func NewGameServer(cfg *config.Config, h *Handler) *GameServer

func (*GameServer) DeleteVM

func (s *GameServer) DeleteVM(ctx context.Context, id string) bool

func (*GameServer) FindVM

func (s *GameServer) FindVM(ctx context.Context) (string, error)

func (*GameServer) IsAvailable

func (s *GameServer) IsAvailable() bool

func (*GameServer) SetUp

func (s *GameServer) SetUp(ctx context.Context, gameConfig *runner.Config, memSizeGB int, startupScript []byte) string

func (*GameServer) StopVM

func (s *GameServer) StopVM(ctx context.Context, id string) bool

func (*GameServer) VMRunning

func (s *GameServer) VMRunning(ctx context.Context, id string) bool

type Handler

type Handler struct {
	GameServer *GameServer
	KVS        kvs.KeyValueStore
	MCVersions mcversions.MCVersionsService
	Streaming  *streaming.StreamingService
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(cfg *config.Config, bindAddr string, db *bun.DB, redis *redis.Client, longpoll *longpoll.PollableActionService, kvs kvs.KeyValueStore) (*Handler, error)

func (*Handler) LaunchServer

func (h *Handler) LaunchServer(ctx context.Context, serverConfig *runner.Config, gameServer *GameServer, memSizeGB int)

func (*Handler) Start

func (h *Handler) Start() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL