Documentation ¶
Index ¶
- Variables
- func ApiGetResponseBody(url string) ([]byte, error)
- func GetCurrencyExchangeRate(fromCurrency, toCurrency, apiKey string) (float64, error)
- func GetStockTimeSeriesIntradayAverage(symbol, key string) (float64, error)
- func IsApiAlphavantage(apiServer string) bool
- func NewApiAlphavantage(apiKey string) api.StockApi
- type ExchangeRate
- type SymbolQuote
- type SymbolSearchMatch
- type TimeSeries
- type TimeSeriesMetaData
- type TsIntraday
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ApiRequestsPerMinLimit = 5 // 0
)
Functions ¶
func ApiGetResponseBody ¶
func GetCurrencyExchangeRate ¶
func IsApiAlphavantage ¶
func NewApiAlphavantage ¶
Types ¶
type ExchangeRate ¶
type ExchangeRate struct { FromCode string `json:"1. From_Currency Code"` FromName string `json:"2. From_Currency Name"` ToCode string `json:"3. To_Currency Code"` ToName string `json:"4. To_Currency Name"` ExchangeRate string `json:"5. Exchange Rate"` LastRefreshed string `json:"6. Last Refreshed"` Timezone string `json:"7. Time Zone"` BidPrice string `json:"8. Bid Price"` AskPrice string `json:"9. Ask Price"` }
func GetCurrencyExchangeRateInfo ¶
func GetCurrencyExchangeRateInfo(fromCurrency, toCurrency, apiKey string) (*ExchangeRate, error)
type SymbolQuote ¶
type SymbolQuote struct { Symbol string `json:"01. symbol"` Open string `json:"02. open"` High string `json:"03. high"` Low string `json:"04. low"` Price string `json:"05. price"` Volume string `json:"06. volume"` LatestTradingDay string `json:"07. latest trading day"` PreviousClose string `json:"08. previous close"` Change string `json:"09. change"` ChangePercent string `json:"10. change percent"` }
func GetSymbolQuote ¶
func GetSymbolQuote(symbol, apiKey string) (*SymbolQuote, error)
type SymbolSearchMatch ¶
type SymbolSearchMatch struct { Symbol string `json:"1. symbol"` Name string `json:"2. name"` Type string `json:"3. type"` Region string `json:"4. region"` MarketOpen string `json:"5. marketOpen"` MarketClose string `json:"6. marketClose"` Timezone string `json:"7. timezone"` Currency string `json:"8. currency"` MatchScore string `json:"9. matchScore"` }
func GetSymbolSearch ¶
func GetSymbolSearch(symbol, apiKey string) (*SymbolSearchMatch, error)
type TimeSeries ¶
type TimeSeriesMetaData ¶
type TsIntraday ¶
type TsIntraday struct { MetaData TimeSeriesMetaData `json:"Meta Data"` Ts map[string]TimeSeries `json:"Time Series (5min)"` }
func GetTimeSeriesIntraday ¶
func GetTimeSeriesIntraday(symbol, apiKey string) (*TsIntraday, error)
Click to show internal directories.
Click to hide internal directories.