Documentation
¶
Index ¶
- func GetAirplanes(ctx context.Context, cfg *Config) (float64, error)
- func GetAssetMix(ctx context.Context) (float64, error)
- func GetBTCPrice(ctx context.Context, cfg *Config) (float64, error)
- func GetChiaPrice(ctx context.Context, cfg *Config) (float64, error)
- func GetCounts(ctx context.Context, cfg *Config) ([]*gql.Stat, error)
- func GetCryptoPrice(ctx context.Context, crypto string) (float64, error)
- func GetETHPrice(ctx context.Context, cfg *Config) (float64, error)
- type Aircraft
- type Config
- type FlexInt
- type KeyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAirplanes ¶
GetAirplanes gets the number of airplanes we can see.
func GetAssetMix ¶
GetAssetMix gets our asset mix from LunchMoney. TODO: Add to config thing.
func GetBTCPrice ¶
GetBTCPrice gets the price of BTC in USD.
func GetChiaPrice ¶
GetChiaPrice gets the price of XCH in USD.
func GetCryptoPrice ¶
GetCryptoPrice gets a crypto in USD from coinbase.
Types ¶
type Aircraft ¶
type Aircraft struct {
AltBaro FlexInt `json:"alt_baro,omitempty"`
AltGeom int `json:"alt_geom,omitempty"`
BaroRate int `json:"baro_rate,omitempty"`
Category string `json:"category,omitempty"`
Emergency string `json:"emergency,omitempty"`
Flight string `json:"flight,omitempty"`
GeomRate int `json:"geom_rate,omitempty"`
Gs float64 `json:"gs,omitempty"`
Gva int `json:"gva,omitempty"`
Hex string `json:"hex"`
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Messages int `json:"messages"`
Mlat []interface{} `json:"mlat"`
NacP int `json:"nac_p,omitempty"`
NacV int `json:"nac_v,omitempty"`
Nic int `json:"nic,omitempty"`
NicBaro int `json:"nic_baro,omitempty"`
Rc int `json:"rc,omitempty"`
Rssi float64 `json:"rssi"`
Sda int `json:"sda,omitempty"`
Seen float64 `json:"seen"`
SeenPos float64 `json:"seen_pos,omitempty"`
Sil int `json:"sil,omitempty"`
SilType string `json:"sil_type,omitempty"`
Squawk string `json:"squawk,omitempty"`
Tisb []interface{} `json:"tisb"`
Track float64 `json:"track,omitempty"`
Type string `json:"type,omitempty"`
Version int `json:"version,omitempty"`
}
Aircraft is a ADS-B aircraft data type.
type Config ¶
Config stores config.
func (*Config) UpdateOften ¶
UpdateOften updates stats that can be fetched quickly.
func (*Config) UpdateRarely ¶
UpdateRarely updates stats that should be fetched less frequently.
type FlexInt ¶
type FlexInt int
FlexInt is an int that can be parsed for json, and if the json is a string, is set to 0.
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface, which allows us to ingest values of any json type as an int and run our custom conversion