models

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Overview

This package provides marshal-able models for all data objects in the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Credits  int             `json:"credits"`
	Loans    []PurchasedLoan `json:"loans"`
	Ships    []OwnedShip     `json:"ships"`
	Username string          `json:"username"`
}

Models the Account object.

type Cargo

type Cargo struct {
	Good     string `json:"good"`
	Quantity int    `json:"quantity"`
}

Models the Cargo object.

type Currency

type Currency float64

Currency is another name for float64.

Intended for representing currency.

type FlightPlan

type FlightPlan struct {
	ArrivesAt              time.Time `json:"arrivesAt"`
	Destination            string    `json:"destination"`
	FuelConsumed           int       `json:"fuelConsumed"`
	FuelRemaining          int       `json:"fuelRemaining"`
	ID                     string    `json:"id"`
	ShipID                 string    `json:"ship"`
	TerminatedAt           time.Time `json:"terminatedAt"`
	TimeRemainingInSeconds int       `json:"timeRemainingInSeconds"`
}

Models the FlightPlan object.

type Loan

type Loan struct {
	Type               string   `json:"type"`
	Amount             Currency `json:"amount"`
	CollateralRequired bool     `json:"collateralRequired"`
	Rate               Currency `json:"rate"`
	TermInDays         int      `json:"termInDays"`
}

Models the Loan object.

type Location

type Location struct {
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Type   string `json:"type"`
	X      int    `json:"x"`
	Y      int    `json:"y"`
}

Models the Location object.

type Modifier

type Modifier float64

Modifier is another name for float64.

Intended for representing modifiers.

type Order

type Order struct {
	Good         string   `json:"good"`
	PricePerUnit Currency `json:"pricePerUnit"`
	Quantity     int      `json:"quantity"`
	TotalPrice   Currency `json:"total"`
}

Models the Order object.

type OwnedShip

type OwnedShip struct {
	Cargo          []Cargo  `json:"cargo"`
	Class          string   `json:"class"`
	ID             string   `json:"id"`
	Location       string   `json:"location"`
	Manufacturer   string   `json:"manufacturer"`
	MaxCargo       int      `json:"maxCargo"`
	Plating        int      `json:"plating"`
	SpaceAvailable int      `json:"spaceAvailable"`
	Speed          Modifier `json:"speed"`
	Type           string   `json:"type"`
	Weapons        int      `json:"weapons"`
}

Models a ship that is owned by the player.

type PurchaseLocation

type PurchaseLocation struct {
	Location string   `json:"location"`
	Price    Currency `json:"price"`
}

Models the PurchaseLocation object.

type PurchasedLoan

type PurchasedLoan struct {
	Due             time.Time `json:"due"`
	ID              string    `json:"id"`
	RepaymentAmount Currency  `json:"repaymentAmount"`
	Status          string    `json:"status"`
	Type            string    `json:"type"`
}

Models a loan that has been purchased.

type Ship

type Ship struct {
	Class             string             `json:"class"`
	DockingEfficiency Modifier           `json:"dockingEfficiency"`
	FuelEfficiency    Modifier           `json:"fuelEfficiency"`
	Maintenance       Modifier           `json:"maintenance"`
	Manufacturer      string             `json:"manufacturer"`
	MaxCargo          int                `json:"maxCargo"`
	Plating           int                `json:"plating"`
	Speed             Modifier           `json:"speed"`
	Type              string             `json:"type"`
	Weapons           int                `json:"weapons"`
	PurchaseLocation  []PurchaseLocation `json:"purchaseLocations"`
}

Models the Ship object.

type ShipOrder

type ShipOrder struct {
	Credits Currency `json:"credits"`
	Orders  []Order  `json:"order"`
	Ship    Ship     `json:"ship"`
}

Models an order that has been purchased or sold by a ship.

Jump to

Keyboard shortcuts

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