Documentation
¶
Index ¶
- Variables
- func DecodeSecretKey(key string) ([]byte, error)
- func GetDate() (string, error)
- func GetHMAC(key []byte, url string, nonce int, date string) (string, error)
- func GetNonce() (int, error)
- type AsteroidResponse
- type AsteroidResponseData
- type BannedPlayersResponse
- type BaseResponse
- type CheaterResponseData
- type CheatersResponse
- type EntityPosition
- type FloatingObjectsResponse
- type GridResponse
- type GridResponseData
- type KickedPlayersResponse
- type PingResponse
- type PingResponseData
- type PlanetResponse
- type PlanetResponseData
- type PlayerResponseData
- type Response
- type ServerResponse
- type ServerResponseData
- type VRageClient
- func (c *VRageClient) GetAsteroids() (*AsteroidResponse, error)
- func (c *VRageClient) GetBannedPlayers() (*BannedPlayersResponse, error)
- func (c *VRageClient) GetCheaters() (*CheatersResponse, error)
- func (c *VRageClient) GetFloatingObjects() (*FloatingObjectsResponse, error)
- func (c *VRageClient) GetGrids() (*GridResponse, error)
- func (c *VRageClient) GetKickedPlayers() (*KickedPlayersResponse, error)
- func (c *VRageClient) GetPlanets() (*PlanetResponse, error)
- func (c *VRageClient) GetServerDetails() (*ServerResponse, error)
- func (c *VRageClient) Ping() (bool, error)
- func (c *VRageClient) Request(path string, method string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodeSecretKey ¶
Decode and return the secret key.
Types ¶
type AsteroidResponse ¶
type AsteroidResponse struct { BaseResponse Data struct { Asteroids []AsteroidResponseData `json:"Asteroids"` } `json:"data"` }
type AsteroidResponseData ¶
type AsteroidResponseData struct { DisplayName string `json:"DisplayName"` EntityId int64 `json:"EntityId"` Position EntityPosition `json:"Position"` }
type BannedPlayersResponse ¶
type BannedPlayersResponse struct { BaseResponse Data struct { BannedPlayers []PlayerResponseData `json:"BannedPlayers"` } `json:"data"` }
type BaseResponse ¶
type CheaterResponseData ¶
type CheatersResponse ¶
type CheatersResponse struct { BaseResponse Data struct { Cheaters []CheaterResponseData `json:"Cheaters"` } `json:"data"` }
type EntityPosition ¶
type FloatingObjectsResponse ¶ added in v0.1.1
type FloatingObjectsResponse struct { BaseResponse Data struct { FloatingObjects []interface{} `json:"FloatingObjects"` } `json:"data"` }
type GridResponse ¶
type GridResponse struct { BaseResponse Data struct { Grids []GridResponseData `json:"Grids"` } `json:"data"` }
type GridResponseData ¶
type GridResponseData struct { DisplayName string `json:"DisplayName"` EntityId int64 `json:"EntityId"` GridSize string `json:"GridSize"` BlocksCount uint `json:"BlocksCount"` Mass float64 `json:"Mass"` Position EntityPosition `json:"Position"` LinearSpeed float64 `json:"LinearSpeed"` DistanceToPlayer float64 `json:"DistanceToPlayer"` OwnerSteamId uint64 `json:"OwnerSteamId"` OwnerDisplayName string `json:"OwnerDisplayName"` IsPowered bool `json:"IsPowered"` PCU uint `json:"PCU"` }
type KickedPlayersResponse ¶
type KickedPlayersResponse struct { BaseResponse Data struct { KickedPlayers []PlayerResponseData `json:"KickedPlayers"` } `json:"data"` }
type PingResponse ¶
type PingResponse struct { BaseResponse Data PingResponseData `json:"data"` }
type PingResponseData ¶
type PingResponseData struct {
Result string `json:"Result"`
}
type PlanetResponse ¶
type PlanetResponse struct { BaseResponse Data struct { Planets []PlanetResponseData `json:"Planets"` } `json:"data"` }
type PlanetResponseData ¶
type PlanetResponseData struct { DisplayName string `json:"DisplayName"` EntityId int64 `json:"EntityId"` Position EntityPosition `json:"Position"` }
type PlayerResponseData ¶
type Response ¶
type Response interface { PingResponse | ServerResponse | PlanetResponse | AsteroidResponse | GridResponse | BannedPlayersResponse | KickedPlayersResponse | CheatersResponse | FloatingObjectsResponse }
Union of all response types
type ServerResponse ¶
type ServerResponse struct { BaseResponse Data ServerResponseData `json:"data"` }
type ServerResponseData ¶
type ServerResponseData struct { IsReady bool `json:"IsReady"` PirateUsedPCU uint `json:"PirateUsedPCU"` Players int `json:"Players"` ServerId uint64 `json:"ServerId"` ServerName string `json:"ServerName"` SimSpeed float64 `json:"SimSpeed"` SimulationCpuLoad float64 `json:"SimulationCpuLoad"` TotalTime uint `json:"TotalTime"` UsedPCU uint `json:"UsedPCU"` Version string `json:"Version"` WorldName string `json:"WorldName"` }
type VRageClient ¶
type VRageClient struct {
// contains filtered or unexported fields
}
func NewVRageClient ¶
func NewVRageClient(api string, keyFile string, key string, sslVerify bool, logger *log.Logger) (*VRageClient, error)
Create and return a new VRage client.
Returns an error if the key is not able to be loaded from the specified key file.
func (*VRageClient) GetAsteroids ¶
func (c *VRageClient) GetAsteroids() (*AsteroidResponse, error)
Retrieve the list of asteroids from the server.
func (*VRageClient) GetBannedPlayers ¶
func (c *VRageClient) GetBannedPlayers() (*BannedPlayersResponse, error)
Retrieve the list of banned players.
func (*VRageClient) GetCheaters ¶
func (c *VRageClient) GetCheaters() (*CheatersResponse, error)
Retrieve the list of cheaters.
func (*VRageClient) GetFloatingObjects ¶ added in v0.1.1
func (c *VRageClient) GetFloatingObjects() (*FloatingObjectsResponse, error)
Retrieve the list of floating objects.
func (*VRageClient) GetGrids ¶
func (c *VRageClient) GetGrids() (*GridResponse, error)
Retrieve the list of grids from the server.
func (*VRageClient) GetKickedPlayers ¶
func (c *VRageClient) GetKickedPlayers() (*KickedPlayersResponse, error)
Retrieve the list of kicked players.
func (*VRageClient) GetPlanets ¶
func (c *VRageClient) GetPlanets() (*PlanetResponse, error)
Retrieve the list of planets from the server.
func (*VRageClient) GetServerDetails ¶
func (c *VRageClient) GetServerDetails() (*ServerResponse, error)
Collect and return the server details.
func (*VRageClient) Ping ¶
func (c *VRageClient) Ping() (bool, error)
Pings the server and returns true if we received a pong, false otherwise.
Click to show internal directories.
Click to hide internal directories.