api

package
v1.0.58 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(endpoint string, filePath string) error

func DownloadNonSSMFile

func DownloadNonSSMFile(url string, filePath string) error

func GetPublicIP

func GetPublicIP() (string, error)

func SendFile

func SendFile(endpoint string, filepath string) error

func SendGetRequest

func SendGetRequest(endpoint string, returnModel interface{}) error

func SendPostRequest

func SendPostRequest(endpoint string, bodyModel interface{}, returnModel interface{}) error

func SendPutRequest added in v1.0.53

func SendPutRequest(endpoint string, bodyModel interface{}, returnModel interface{}) error

Types

type APIError

type APIError struct {
	ResponseCode int
}

func (*APIError) Error

func (e *APIError) Error() string

type HTTPRequestBody_Config

type HTTPRequestBody_Config struct {
	Version string `json:"version"`
	IP      string `json:"ip"`
}

type HttpRequestBody_Status added in v1.0.53

type HttpRequestBody_Status struct {
	Online             bool    `json:"online"`
	Installed          bool    `json:"installed"`
	Running            bool    `json:"running"`
	CPU                float64 `json:"cpu"`
	MEM                float32 `json:"mem"`
	InstalledSFVersion int64   `json:"installedSFVersion"`
	LatestSFVersion    int64   `json:"latestSFVersion"`
}

type HttpResponseBody

type HttpResponseBody struct {
	Success bool        `json:"success"`
	Error   string      `json:"error"`
	Data    interface{} `json:"data"`
}

type HttpResponseBody_Config

type HttpResponseBody_Config struct {
	Config       HttpResponseBody_Config_Config       `json:"config"`
	ServerConfig HttpResponseBody_Config_ServerConfig `json:"serverConfig"`
}

type HttpResponseBody_Config_Config added in v1.0.53

type HttpResponseBody_Config_Config struct {
	BackupKeepAmount int `json:"backupKeepAmount"`
	BackupInterval   int `json:"backupInterval"`
}

type HttpResponseBody_Config_ServerConfig added in v1.0.53

type HttpResponseBody_Config_ServerConfig struct {
	SFBranch              string  `json:"branch"`
	WorkerThreads         int     `json:"workerThreads"`
	MaxPlayers            int     `json:"maxPlayers"`
	UpdateOnStart         bool    `json:"checkForUpdatesOnStart"`
	AutoRestart           bool    `json:"autoRestartServer"`
	AutoPause             bool    `json:"autoPause"`
	AutoSaveOnDisconnect  bool    `json:"autoSaveOnDisconnect"`
	AutoSaveInterval      float32 `json:"autoSaveInterval"`
	DisableSeasonalEvents bool    `json:"disableSeasonalEvents"`
}

type IP

type IP struct {
	Query string
}

Jump to

Keyboard shortcuts

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