broker

package
v0.0.0-...-3338124 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2016 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package broker allows to get static data of a list of brokers defined in the brokers.json file. This data can be used e.g. to calculate order prices with github.com/MaximilianMeister/asset/order

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBroker

func IsBroker(brokerAlias string) error

IsBroker returns bool if broker is available

Types

type Broker

type Broker struct {
	Name           string          `json:"name"`
	BasicPrice     decimal.Decimal `json:"basic_price"`
	CommissionRate decimal.Decimal `json:"commission_rate"`
	MinRate        decimal.Decimal `json:"min_rate"`
	MaxRate        decimal.Decimal `json:"max_rate"`
}

Broker contains static broker data

func FindBroker

func FindBroker(brokerAlias string) (Broker, error)

FindBroker returns a Broker type with all static data about a single broker

type Brokers

type Brokers map[string]Broker

Brokers represents a map of all brokers and their static data

func NewBrokers

func NewBrokers() (Brokers, error)

NewBrokers returns a map of type Brokers which contains all static broker data defined in brokers.json

type InvalidBrokerError

type InvalidBrokerError struct {
	// contains filtered or unexported fields
}

InvalidBrokerError represents an error for a non existing Broker

func (*InvalidBrokerError) Error

func (e *InvalidBrokerError) Error() string

Jump to

Keyboard shortcuts

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