Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gofer ¶
type Gofer interface { // Models describes price models which are used to calculate prices. // If no pairs are specified, models for all pairs are returned. Models(pairs ...Pair) (map[Pair]*Model, error) // Price returns a Price for the given pair. Price(pair Pair) (*Price, error) // Prices returns prices for the given pairs. If no pairs are specified, // prices for all pairs are returned. Prices(pairs ...Pair) (map[Pair]*Price, error) // Pairs returns all pairs. Pairs() ([]Pair, error) }
Gofer provides prices for asset pairs.
type Model ¶
type Model struct { // Type is used to differentiate between model types. Type string // Parameters is a optional list of model's parameters. Parameters map[string]string // Pair is a asset pair for which this model returns a price. Pair Pair // Models is a list of sub models used to calculate price. Models []*Model }
Model is a simplified representation of a model which is used to calculate asset pair prices. The main purpose of this structure is to help the end user to understand how prices are derived and calculated.
This structure is purely informational. The way it is used depends on a specific implementation.
type Pair ¶
Pair represents an asset pair.
func NewPair ¶
NewPair returns a new Pair for given string. The string must be formatted as "BASE/QUOTE".
type Price ¶
type Price struct { Type string Parameters map[string]string Pair Pair Price float64 Bid float64 Ask float64 Volume24h float64 Time time.Time Prices []*Price Error string }
Price represents price for a single pair. If the Price price was calculated indirectly it will also contain all prices used to calculate the price.
Click to show internal directories.
Click to hide internal directories.