stock

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHistory

func GetHistory(ticker string, commodityName string) ([]*price.Price, error)

Types

type AlphaVantageExchangePrice added in v0.6.1

type AlphaVantageExchangePrice struct {
	Date  time.Time
	Close decimal.Decimal
}

func (AlphaVantageExchangePrice) Less added in v0.6.1

type AlphaVantagePriceProvider added in v0.6.1

type AlphaVantagePriceProvider struct {
}

func (*AlphaVantagePriceProvider) AutoComplete added in v0.6.1

func (p *AlphaVantagePriceProvider) AutoComplete(db *gorm.DB, field string, filter map[string]string) []price.AutoCompleteItem

func (*AlphaVantagePriceProvider) AutoCompleteFields added in v0.6.1

func (p *AlphaVantagePriceProvider) AutoCompleteFields() []price.AutoCompleteField

func (*AlphaVantagePriceProvider) ClearCache added in v0.6.1

func (p *AlphaVantagePriceProvider) ClearCache(db *gorm.DB)

func (*AlphaVantagePriceProvider) Code added in v0.6.1

func (*AlphaVantagePriceProvider) Description added in v0.6.1

func (p *AlphaVantagePriceProvider) Description() string

func (*AlphaVantagePriceProvider) GetPrices added in v0.6.1

func (p *AlphaVantagePriceProvider) GetPrices(code string, commodityName string) ([]*price.Price, error)

func (*AlphaVantagePriceProvider) Label added in v0.6.1

func (p *AlphaVantagePriceProvider) Label() string

type Chart

type Chart struct {
	Result []Result
}

type DailyPrice added in v0.6.1

type DailyPrice struct {
	Close string `json:"4. close"`
}

type ErrorResponse added in v0.6.1

type ErrorResponse struct {
	Information string `json:"Information"`
}

type ExchangePrice

type ExchangePrice struct {
	Timestamp int64
	Close     float64
}

func (ExchangePrice) Less

func (p ExchangePrice) Less(o btree.Item) bool

type FXSeriesDailyReponse added in v0.6.1

type FXSeriesDailyReponse struct {
	TimeSeriesFX map[string]DailyPrice `json:"Time Series FX (Daily)"`
}

type Indicators

type Indicators struct {
	Quote []Quote
}

type Match added in v0.6.1

type Match struct {
	Symbol   string `json:"1. symbol"`
	Name     string `json:"2. name"`
	Type     string `json:"3. type"`
	Region   string `json:"4. region"`
	Currency string `json:"8. currency"`
}

type Meta

type Meta struct {
	Currency string
}

type Quote

type Quote struct {
	Close []float64
}

type Response

type Response struct {
	Chart Chart
}

type Result

type Result struct {
	Timestamp  []int64
	Indicators Indicators
	Meta       Meta
}

type SearchResponse added in v0.6.1

type SearchResponse struct {
	BestMatches []Match `json:"bestMatches"`
}

type TimeSeriesDailyReponse added in v0.6.1

type TimeSeriesDailyReponse struct {
	TimeSeriesDaily map[string]DailyPrice `json:"Time Series (Daily)"`
}

type YahooPriceProvider added in v0.6.1

type YahooPriceProvider struct {
}

func (*YahooPriceProvider) AutoComplete added in v0.6.1

func (p *YahooPriceProvider) AutoComplete(db *gorm.DB, field string, filter map[string]string) []price.AutoCompleteItem

func (*YahooPriceProvider) AutoCompleteFields added in v0.6.1

func (p *YahooPriceProvider) AutoCompleteFields() []price.AutoCompleteField

func (*YahooPriceProvider) ClearCache added in v0.6.1

func (p *YahooPriceProvider) ClearCache(db *gorm.DB)

func (*YahooPriceProvider) Code added in v0.6.1

func (p *YahooPriceProvider) Code() string

func (*YahooPriceProvider) Description added in v0.6.1

func (p *YahooPriceProvider) Description() string

func (*YahooPriceProvider) GetPrices added in v0.6.1

func (p *YahooPriceProvider) GetPrices(code string, commodityName string) ([]*price.Price, error)

func (*YahooPriceProvider) Label added in v0.6.1

func (p *YahooPriceProvider) Label() string

Jump to

Keyboard shortcuts

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