Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Credits = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "credits", Help: "How much credits user has", }, []string{"username"}) GameStatus = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "game_status", Help: "Indicates if the game is up, running and available", }, []string{"username"}) ShipCount = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "shipcount", Help: "Total of ships user has", }, []string{"username"}) StructureCount = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "structurecount", Help: "Total of structure user has", }, []string{"username"}) ShipLoad = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "shipload", Help: "Unused space in ship cargo", }, []string{"username", "id", "class", "manufacturer", "type", "maxcargo", "plating", "speed", "weapons"}) UserRank = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, Name: "userrank", Help: "User rank in leaderboard", }, []string{"username"}) )
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy interface { // GetUserDetails collects user details. // // https://api.spacetraders.io/#api-account-GetAccount GetUserDetails() ([]byte, error) // GetShipList collects the list of ships the user owns. // // https://api.spacetraders.io/#api-ships-GetShips GetShipList() ([]byte, error) // GetLeaderboard collects the leaderboard and the user rank. // // https://api.spacetraders.io/#api-leaderboard-netWorth GetLeaderboard() ([]byte, error) // GetGameStatus collects the game status (if it is online and accessible). // // https://api.spacetraders.io/#api-game-Status GetGameStatus() ([]byte, error) }
Proxy represents the interface the Proxy to the game API needs to provide.
func NewWebProxy ¶
NewWebProxy creates a new instance of WebProxy.
token is provided by the game when you claim your username.
type WebProxy ¶
type WebProxy struct {
// contains filtered or unexported fields
}
WebProxy is an implementation of web.Proxy.
func (*WebProxy) GetGameStatus ¶
GetGameStatus collects the game status (if it is online and accessible).
func (*WebProxy) GetLeaderboard ¶
GetLeaderboard collects the leaderboard and the user rank.
func (*WebProxy) GetShipList ¶
GetShipList collects the list of ships the user owns.
func (*WebProxy) GetUserDetails ¶
GetUserDetails collects user details.
Click to show internal directories.
Click to hide internal directories.