model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YahooChartResponse

type YahooChartResponse struct {
	Chart struct {
		Result []struct {
			Meta struct {
				Currency        string          `json:"currency"`
				Symbol          string          `json:"symbol"`
				ExchangeName    string          `json:"exchangeName"`
				InstrumentType  string          `json:"instrumentType"`
				FirstTradeDate  int64           `json:"firstTradeDate"`
				GMTOffset       int64           `json:"gmtoffset"`
				Timezone        string          `json:"timezone"`
				PreviousClose   float32         `json:"previousClose"`
				Scale           int             `json:"scale"`
				TradingPeriods  json.RawMessage `json:"tradingPeriods"`
				DataGranularity string          `json:"dataGranularity"`
				ValidRanges     []string        `json:"validRanges"`
			} `json:"meta"`
			Timestamp  []int64 `json:"timestamp"`
			Indicators struct {
				Quote []struct {
					Open   []float64 `json:"open"`
					Close  []float64 `json:"close"`
					High   []float64 `json:"high"`
					Low    []float64 `json:"low"`
					Volume []int64   `json:"volume"`
				} `json:"quote"`
				Adjclose []struct {
					Adjclose []float64 `json:"adjclose"`
				} `json:"adjclose"`
			} `json:"indicators"`
		} `json:"result"`
		Err *struct {
			Code        string `json:"code"`
			Description string `json:"description"`
		} `json:"error"`
	} `json:"chart"`
}

func (YahooChartResponse) ToAdjQuotes

func (r YahooChartResponse) ToAdjQuotes() *entity.Quotes

func (YahooChartResponse) Valid

func (r YahooChartResponse) Valid() bool

type YahooQuoteDownloader

type YahooQuoteDownloader struct{}

func GetYahooQuoteDownloader

func GetYahooQuoteDownloader() *YahooQuoteDownloader

func (YahooQuoteDownloader) DailyAll

func (s YahooQuoteDownloader) DailyAll(code string) (*entity.Quotes, error)

func (YahooQuoteDownloader) DailyOfYear

func (s YahooQuoteDownloader) DailyOfYear(code string, year int) (*YahooChartResponse, bool, error)

Jump to

Keyboard shortcuts

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