models

package
v0.0.0-...-5bdfbad Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTradeType = []TradeType{
	TradeTypeBuy,
	TradeTypeSell,
}

Functions

This section is empty.

Types

type Bpi

type Bpi struct {
	USD `json:"USD"`
	GBP `json:"GBP"`
	EUR `json:"EUR"`
}

type CurrentPrice

type CurrentPrice struct {
	Time struct {
		Updated    string    `json:"updated"`
		UpdatedISO time.Time `json:"updatedISO"`
		Updateduk  string    `json:"updateduk"`
	} `json:"time"`
	Disclaimer string `json:"disclaimer"`
	ChartName  string `json:"chartName"`
	Bpi        `json:"bpi"`
}

type EUR

type EUR struct {
	Code        string  `json:"code"`
	Symbol      string  `json:"symbol"`
	Rate        string  `json:"rate"`
	Description string  `json:"description"`
	RateFloat   float64 `json:"rate_float"`
}

type GBP

type GBP struct {
	Code        string  `json:"code"`
	Symbol      string  `json:"symbol"`
	Rate        string  `json:"rate"`
	Description string  `json:"description"`
	RateFloat   float64 `json:"rate_float"`
}

type Rate

type Rate struct {
	ID        string    `json:"id" bson:"id"`
	Exchange  float64   `json:"exchange" bson:"exchange"`
	TradeType string    `json:"trade_type" bson:"trade_type"`
	Price     float64   `json:"price"`
	Ts        time.Time `json:"ts" bson:"ts"`
}

type TradeType

type TradeType string
const (
	TradeTypeBuy  TradeType = "buy"
	TradeTypeSell TradeType = "sell"
)

func (TradeType) IsValid

func (e TradeType) IsValid() bool

func (TradeType) MarshalGQL

func (e TradeType) MarshalGQL(w io.Writer)

func (TradeType) String

func (e TradeType) String() string

func (*TradeType) UnmarshalGQL

func (e *TradeType) UnmarshalGQL(v interface{}) error

type USD

type USD struct {
	Code        string  `json:"code"`
	Symbol      string  `json:"symbol"`
	Rate        string  `json:"rate"`
	Description string  `json:"description"`
	RateFloat   float64 `json:"rate_float"`
}

Jump to

Keyboard shortcuts

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