runner

package
v0.0.0-...-72177e3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

View Source
const (
	EventHello   EventType = "hello"
	EventStatus            = "status"
	EventSysstat           = "sysstat"
	EventInfo              = "info"
	EventStarted           = "started"
)
View Source
const (
	EventShutdown      entity.EventCode = iota + 1 // 1
	EventSysInit                                   // 2
	EventGameDownload                              // 3
	EventWorldDownload                             // 4
	EventWorldPrepare                              // 5
	EventWorldUpload                               // 6
	EventLoading                                   // 7
	EventRunning                                   // 8
	EventStopping                                  // 9
	EventCrashed                                   // 10
	EventClean                                     // 11
)
View Source
const (
	EventGameErr   entity.EventCode = iota + 50 // 50
	EventWorldErr                               // 51
	EventLaunchErr                              // 52
)

Event codes that should be provided UI to retry.

View Source
const (
	InfoSnapshotDone  entity.InfoCode = iota + 1 // 1
	InfoSnapshotError                            // 2
	InfoNoSnapshot                               // 3
)
View Source
const (
	ActionStop        ActionType = "stop"
	ActionSnapshot               = "snapshot"
	ActionUndo                   = "undo"
	ActionReconfigure            = "reconfigure"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type   ActionType `json:"type"`
	Config *Config    `json:"config,omitempty"`
}

type ActionType

type ActionType string

type Config

type Config struct {
	AllocSize int    `json:"allocSize"`
	AuthKey   string `json:"authKey"`
	Server    struct {
		Version     string `json:"name"`
		DownloadUrl string `json:"downloadUrl"`
	} `json:"server"`
	World struct {
		ShouldGenerate bool   `json:"shouldGenerate"`
		Name           string `json:"name"`
		GenerationId   string `json:"generationId"`
		Seed           string `json:"seed"`
		LevelType      string `json:"levelType"`
		Difficulty     string `json:"difficulty"`
	} `json:"world"`
	Motd      string   `json:"motd"`
	Operators []string `json:"operators"`
	Whitelist []string `json:"whitelist"`
	AWS       struct {
		AccessKey string
		SecretKey string
	} `json:"aws"`
	S3 struct {
		Endpoint string `json:"endpoint"`
		Bucket   string `json:"bucket"`
	} `json:"s3"`
	ControlPanel string `json:"controlPanel"`
}

type Event

type Event struct {
	Type    EventType     `json:"type"`
	Hello   *HelloExtra   `json:"hello,omitempty"`
	Status  *StatusExtra  `json:"status,omitempty"`
	Sysstat *SysstatExtra `json:"sysstat,omitempty"`
	Info    *InfoExtra    `json:"info,omitempty"`
	Started *StartedExtra `json:"started,omitempty"`
}

type EventType

type EventType string

type HelloExtra

type HelloExtra struct {
	Version string `json:"version"`
	Host    string `json:"host"`
}

type InfoExtra

type InfoExtra struct {
	InfoCode entity.InfoCode `json:"infoCode"`
	IsError  bool            `json:"isError"`
}

type Message

type Message struct {
	Type     string `json:"type"`
	UserData string `json:"user_data"`
}

type StartedExtra

type StartedExtra struct {
	ServerVersion string `json:"serverVersion"`
	World         struct {
		Name string `json:"name"`
		Seed string `json:"seed"`
	} `json:"world"`
}

type StatusExtra

type StatusExtra struct {
	EventCode entity.EventCode `json:"eventCode"`
	Progress  int              `json:"progress"`
}

type SysstatExtra

type SysstatExtra struct {
	CPUUsage float64 `json:"cpuUsage"`
	Time     int64   `json:"time"`
}

Jump to

Keyboard shortcuts

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