handler

package
v0.0.0-...-12f3b1c Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheKeyBackups          = "backups"
	CacheKeyMCVersions       = "mcversions"
	CacheKeySystemInfoPrefix = "system-info"
)

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) 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) (*Handler, error)

func (*Handler) LaunchServer

func (h *Handler) LaunchServer(ctx context.Context, gameConfig *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