launch

package
v12.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 License: MIT Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCandidateDisappeared = goerrors.New("candidate disappeared from disk!")
View Source
var ErrNoCandidates = goerrors.New("no candidates")

Functions

func Register

func Register(router *butlerd.Router)

func RegisterLauncher

func RegisterLauncher(strategy LaunchStrategy, launcher Launcher)

Types

type LaunchStrategy

type LaunchStrategy string
const (
	LaunchStrategyUnknown LaunchStrategy = ""
	LaunchStrategyNative  LaunchStrategy = "native"
	LaunchStrategyHTML    LaunchStrategy = "html"
	LaunchStrategyURL     LaunchStrategy = "url"
	LaunchStrategyShell   LaunchStrategy = "shell"
)

type Launcher

type Launcher interface {
	Do(params *LauncherParams) error
}

type LauncherParams

type LauncherParams struct {
	RequestContext *butlerd.RequestContext
	Ctx            context.Context

	// If relative, it's relative to the WorkingDirectory
	FullTargetPath string

	// May be nil
	Candidate *configurator.Candidate

	// May be nil
	AppManifest *butlerd.Manifest

	// May be nil
	Action *butlerd.Action

	// If true, enable sandbox
	Sandbox bool

	// Additional command-line arguments
	Args []string

	// Additional environment variables
	Env map[string]string

	PrereqsDir    string
	Credentials   *butlerd.GameCredentials
	InstallFolder string
	Runtime       *manager.Runtime

	RecordPlayTime RecordPlayTimeFunc
}

type RecordPlayTimeFunc

type RecordPlayTimeFunc func(playTime time.Duration) error

type StrategyResult

type StrategyResult struct {
	Strategy       LaunchStrategy
	FullTargetPath string
	Candidate      *configurator.Candidate
}

func DetermineCandidateStrategy

func DetermineCandidateStrategy(basePath string, candidate *configurator.Candidate) (*StrategyResult, error)

func DetermineStrategy

func DetermineStrategy(runtime *manager.Runtime, installFolder string, manifestAction *butlerd.Action) (*StrategyResult, error)

func (*StrategyResult) String

func (sr *StrategyResult) String() string

Directories

Path Synopsis
launchers
url

Jump to

Keyboard shortcuts

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