models

package
v0.0.0-...-299512e Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CurrencySymbolUSD captures enum value "USD"
	CurrencySymbolUSD string = "USD"

	// CurrencySymbolBTC captures enum value "BTC"
	CurrencySymbolBTC string = "BTC"

	// CurrencySymbolNZD captures enum value "NZD"
	CurrencySymbolNZD string = "NZD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency struct {
	// name
	Name string `json:"name,omitempty"`

	// pair
	Pair string `json:"pair,omitempty"`

	// symbol
	Symbol string `json:"symbol,omitempty"`

	// value
	Value *float32 `json:"value,omitempty"`
}

Currency currency

func (*Currency) ConvertHistoryPeriod

func (m *Currency) ConvertHistoryPeriod(period string) int

func (*Currency) HistoryIndex

func (m *Currency) HistoryIndex(key string) float64

Returns the last index value of sorted list

func (*Currency) HistoryKey

func (m *Currency) HistoryKey(otherCoinSymbol string, period int) string

func (*Currency) HistoryMilestones

func (m *Currency) HistoryMilestones(pair string, period int, start int64, end int64) []*CurrencyMilestone

func (*Currency) HistoryPeriods

func (m *Currency) HistoryPeriods() []int

func (*Currency) LoadPrice

func (m *Currency) LoadPrice(otherCoinSymbol *string) float32

func (*Currency) MarshalBinary

func (m *Currency) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Currency) Price

func (m *Currency) Price(convert *string) float32

func (*Currency) PriceKey

func (m *Currency) PriceKey(otherCoinSymbol string) string

func (*Currency) UnmarshalBinary

func (m *Currency) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Currency) UpdateHistory

func (m *Currency) UpdateHistory(otherCoinSymbol string, score float64, period int, milestone CurrencyMilestone)

func (*Currency) UpdatePrice

func (m *Currency) UpdatePrice(convert string, price float64)

type CurrencyMilestone

type CurrencyMilestone struct {

	// at
	// Format: datetime
	At strfmt.DateTime `json:"at,omitempty"`

	// close
	Close float64 `json:"close,omitempty"`

	// max
	Max float64 `json:"max,omitempty"`

	// min
	Min float64 `json:"min,omitempty"`

	// open
	Open float64 `json:"open,omitempty"`
}

CurrencyMilestone currency milestone swagger:model CurrencyMilestone

func (*CurrencyMilestone) MarshalBinary

func (m *CurrencyMilestone) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*CurrencyMilestone) UnmarshalBinary

func (m *CurrencyMilestone) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*CurrencyMilestone) Validate

func (m *CurrencyMilestone) Validate(formats strfmt.Registry) error

Validate validates this currency milestone

type Price

type Price struct {
	Price float32 `json:"price"`
}

Price price

Jump to

Keyboard shortcuts

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