gamelaunch

package
v0.0.0-...-05a8283 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHostKeys

func GenerateHostKeys(dir string, options KeygenOptions) ([]string, error)

GenerateHostKeys generates SSH Ed25519 host keys and writes them to the specified directory Returns the paths to the generated key files

Types

type GameConfig

type GameConfig struct {
	ID      string
	Name    string
	Command string
	Args    []string
	Env     []string
}

GameConfig represents a single game configuration

type KeygenOptions

type KeygenOptions struct {
	// OverwriteExisting determines whether to overwrite existing key files
	OverwriteExisting bool
}

KeygenOptions configures key generation behavior

func DefaultKeygenOptions

func DefaultKeygenOptions() KeygenOptions

DefaultKeygenOptions returns the default options for key generation

type Launcher

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

Launcher is the main game launcher service

func NewLauncher

func NewLauncher(configPath string, opts ...Option) (*Launcher, error)

NewLauncher creates a new launcher instance from configuration

func NewLauncherWithListener

func NewLauncherWithListener(configPath string, listener net.Listener) (*Launcher, error)

NewLauncherWithListener creates a launcher with a custom listener This is a convenience constructor for the common use case

func (*Launcher) Address

func (l *Launcher) Address() string

Address returns the server listening address Returns empty string if using custom listener

func (*Launcher) Games

func (l *Launcher) Games() map[string]GameConfig

Games returns a copy of the games configuration

func (*Launcher) LaunchGameWithPTY

func (l *Launcher) LaunchGameWithPTY(gameID string, session ssh.Session, ptyReq ssh.Pty, winCh <-chan ssh.Window) error

LaunchGameWithPTY launches a game with proper PTY handling

func (*Launcher) Serve

func (l *Launcher) Serve() error

Serve starts the SSH server

func (*Launcher) ServeWithListener

func (l *Launcher) ServeWithListener(listener net.Listener) error

ServeWithListener starts the SSH server with a provided listener This allows runtime listener injection

func (*Launcher) Server

func (l *Launcher) Server() *gssh.Server

Server returns the underlying SSH server for advanced configuration

type Option

type Option func(*Launcher) error

Option is a functional option for configuring the Launcher

func WithConfig

func WithConfig(v *viper.Viper) Option

WithConfig allows passing a pre-configured viper instance

func WithListener

func WithListener(listener net.Listener) Option

WithListener sets a custom net.Listener for the SSH server

Jump to

Keyboard shortcuts

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