cmd

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const MS_AUTH_CLIENT_ID = "056aa695-390f-4d6d-a1b6-fc52d083ccc9"

Variables

View Source
var (
	StatusIdle           = "idle"
	StatusStarting       = "starting"
	StatusRunningLoading = "running:loading"
	StatusRunningReady   = "running:ready"
)
View Source
var (

	// Version is the current version. it should be set by goreleaser
	Version string
	// commit is also set by goreleaser (in main.go)
	Commit string
)
View Source
var (
	MinecraftVersionFlag string
)

Functions

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherwise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type CrashEvent added in v0.1.8

type CrashEvent struct {
	Message string `json:"message"`
	Error   error  `json:"error"`
	Stack   string `json:"stack"`
}

type GameLogEvent added in v0.1.11

type GameLogEvent struct {
	Log string `json:"log"`
	Tag string `json:"tag,omitempty"`
}

type InitialStatusEvent added in v0.1.10

type InitialStatusEvent struct {
	Status string `json:"status"`
	Logs   string `json:"logs"`
}

type LocalState added in v0.1.10

type LocalState struct {
	Status string     `json:"status"`
	Stats  StatsState `json:"stats"`
}

type LogForwarder added in v0.1.8

type LogForwarder struct {
	TheThing *TheThing
	// contains filtered or unexported fields
}

func (*LogForwarder) Write added in v0.1.8

func (f *LogForwarder) Write(p []byte) (n int, err error)

type MinepkgMapping

type MinepkgMapping struct {
	Platform string `json:"platform"`
	Modpack  string `json:"modpack"`
}

MinepkgMapping is a server mapping (very unfinished)

type OutdatedChecker added in v0.1.19

type OutdatedChecker struct {
	Context  context.Context
	Instance *instances.Instance
	// contains filtered or unexported fields
}

func (*OutdatedChecker) Check added in v0.1.19

func (o *OutdatedChecker) Check() error

func (*OutdatedChecker) ProgressPercent added in v0.1.19

func (o *OutdatedChecker) ProgressPercent() float64

ProgressPercent returns the current progress of the check in percent

func (*OutdatedChecker) ProgressValue added in v0.1.19

func (o *OutdatedChecker) ProgressValue() int

func (*OutdatedChecker) Total added in v0.1.19

func (o *OutdatedChecker) Total() int

Total returns the total number of packages to check

type ProgressEvent added in v0.1.8

type ProgressEvent struct {
	Progress float32 `json:"progress"`
	Message  string  `json:"message"`
}

type Root added in v0.1.5

type Root struct {
	HTTPClient *http.Client
	MinepkgAPI *api.MinepkgClient

	NonInteractive bool
	ProviderStore  *provider.Store
	AutoCompleter  *autocomplete.AutoCompleter
	// contains filtered or unexported fields
}

func (*Root) LocalInstance added in v0.1.11

func (r *Root) LocalInstance() (*instances.Instance, error)

type StateResponse added in v0.1.11

type StateResponse struct {
	Status   string             `json:"status,omitempty"`
	Stats    StatsState         `json:"stats,omitempty"`
	Manifest *manifest.Manifest `json:"manifest,omitempty"`
	Logs     []*GameLogEvent    `json:"logs,omitempty"`
}

type StatsEvent added in v0.1.8

type StatsEvent struct {
	Memory               *mem.VirtualMemoryStat `json:"memory"`
	ProcessMemoryPercent float32                `json:"processMemoryPercent"`
	ProcessMemoryMiB     float32                `json:"processMemoryMiB"`
	ProcessCPUPercent    float64                `json:"processCPUPercent"`
}

type StatsState added in v0.1.10

type StatsState struct {
	Memory []float32 `json:"memory"`
	CPU    []float32 `json:"cpu"`
}

type TheThing added in v0.1.10

type TheThing struct {
	*remote.Connection
	State *LocalState
	// contains filtered or unexported fields
}

func (*TheThing) Launch added in v0.1.11

func (t *TheThing) Launch(man *manifest.Manifest) error

func (*TheThing) Stop added in v0.1.11

func (t *TheThing) Stop() error

func (*TheThing) WriteLog added in v0.1.11

func (t *TheThing) WriteLog(log *GameLogEvent)

writes log stores the last 100 lines of logs in `logsBuffer`

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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