Download mods and headless server
till working on improvements to code this more like a savepoint.
This commit is contained in:
58
structs.go
Normal file
58
structs.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package main
|
||||
|
||||
// config struct
|
||||
type GoConfig struct {
|
||||
Server struct { // server specific settings
|
||||
ServDir string `yaml:"serverFolder"`
|
||||
WorldFile string `yaml:"worldFile"`
|
||||
ServCfg string `yaml:"serverSettings"`
|
||||
ServExec string `yaml:"serverExec"`
|
||||
ServPort int `yaml:"port"`
|
||||
} `yaml:"server"`
|
||||
|
||||
Factoryman struct { // factoryman settings
|
||||
BackupDir string `yaml:"backupDir"`
|
||||
UseScreen bool `yaml:"screen"`
|
||||
ScreenName string `yaml:"screenName"`
|
||||
UserName string `yaml:"username"`
|
||||
ApiToken string `yaml:"apitoken"`
|
||||
} `yaml:"factoryman"`
|
||||
}
|
||||
|
||||
// JSON file from config
|
||||
type Mod struct {
|
||||
Name string `json:"name"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
type ModList struct {
|
||||
Mods []Mod `json:"mods"`
|
||||
}
|
||||
|
||||
// JSON response from mod poartal api
|
||||
type ModPortal struct {
|
||||
Category string `json:"category"`
|
||||
DownloadCount int `json:"downloads_count"`
|
||||
Name string `json:"name"`
|
||||
Owner string `json:"owner"`
|
||||
Releases []Release `json:"releases"`
|
||||
Score float64 `json:"score"`
|
||||
Summary string `json:"summary"`
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type Release struct {
|
||||
DownloadUrl string `json:"download_url"`
|
||||
Filename string `json:"file_name"`
|
||||
InfoJson InfoJSON `json:"info_json"`
|
||||
ReleaseTime string `json:"released_at"`
|
||||
Sha1 string `json:"sha1"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type InfoJSON struct {
|
||||
Dependencies []string `json:"dependencies"`
|
||||
FactorioVersion string `json:"factorio_version"`
|
||||
}
|
||||
Reference in New Issue
Block a user