api

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 11 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

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"`
	SFInstalled int    `json:"sfinstalledver"`
	SFAvailable int    `json:"sfavailablever"`
	IP          string `json:"ipaddress"`
}

type HttpRequestBody_ActiveState

type HttpRequestBody_ActiveState struct {
	Active bool `json:"active"`
}

type HttpRequestBody_SFState

type HttpRequestBody_SFState struct {
	Installed bool    `json:"installed"`
	Running   bool    `json:"running"`
	CPU       float64 `json:"cpu"`
	MEM       float32 `json:"mem"`
}

type HttpResponseBody

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

type HttpResponseBody_Backup

type HttpResponseBody_Backup struct {
	Interval   int `json:"interval"`
	Keep       int `json:"keep"`
	NextBackup int `json:"nextbackup"`
}

type HttpResponseBody_Config

type HttpResponseBody_Config struct {
	SFBranch              string                  `json:"sfBranch"`
	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"`
	Backup                HttpResponseBody_Backup `json:"backup"`
}

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