fetcher

package
v0.0.0-...-cc17c53 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetData

func GetData(f Fetcher, params map[string]string) (interface{}, error)

GetData returns market data for the supplied Fetcher and request params

Types

type AlphaFetcher

type AlphaFetcher struct {
	// contains filtered or unexported fields
}

func NewAlphaFetcher

func NewAlphaFetcher(r rpc.Client, k string) *AlphaFetcher

func (*AlphaFetcher) GetData

func (p *AlphaFetcher) GetData(request string) (interface{}, error)

func (*AlphaFetcher) MakeRequest

func (p *AlphaFetcher) MakeRequest(requestParams map[string]string) string

type Fetcher

type Fetcher interface {
	GetData(request string) (interface{}, error)
	MakeRequest(requestParams map[string]string) string
	// contains filtered or unexported methods
}

Fetcher is the interface for obtaining market data via external API call

type StockDataAlpha

type StockDataAlpha struct {
	MetaData struct {
		Information string `json:"1. Information"`
		Symbol      string `json:"2. Symbol"`
		LastRefresh string `json:"3. Last Refreshed"`
		OutputSize  string `json:"4. Output Size"`
		TimeZone    string `json:"5. Time Zone"`
	} `json:"Meta Data"`
	TimeSeriesDaily map[string]struct {
		Open   string `json:"1. open"`
		High   string `json:"2. high"`
		Low    string `json:"3. low"`
		Close  string `json:"4. close"`
		Volume string `json:"5. volume"`
	} `json:"Time Series (Daily)"`
}

Jump to

Keyboard shortcuts

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