iexcloud

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

README

iexcloud

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPClient to use for IEXCloud API requests.
	HTTPClient http.Client = http.Client{
		Timeout: time.Second * 15,
	}
)

Functions

func SetEnvironment added in v0.1.9

func SetEnvironment(environment Environment)

SetEnvironment sets the desired environment within the IEXCloud API.

func SetToken added in v0.1.9

func SetToken(token string)

SetToken sets your API token for authentication with the IEXCloud API.

func Stream added in v0.1.1

func Stream(parameters *Parameters) chan *Message

Stream https://iexcloud.io/docs/api/#sse-streaming Requires the following parameters: endpoint, channels, symbols

Types

type Data added in v0.1.3

type Data map[string]interface{}

Data https://iexcloud.io/docs/api/#sse-streaming

func (Data) ContainsKey added in v0.1.3

func (d Data) ContainsKey(key string) bool

ContainsKey null

func (Data) Float32 added in v0.1.3

func (d Data) Float32(key string) float32

Float32 null

func (Data) Float64 added in v0.1.3

func (d Data) Float64(key string) float64

Float64 null

func (Data) Int added in v0.1.3

func (d Data) Int(key string) int

Int null

func (Data) Int64 added in v0.1.3

func (d Data) Int64(key string) int64

Int64 null

func (Data) Interface added in v0.1.3

func (d Data) Interface(key string) interface{}

Interface null

func (Data) String added in v0.1.3

func (d Data) String(key string) string

String null

type Environment added in v0.1.1

type Environment int

Environment the IEXCloud API environment.

const (
	Sandbox Environment = iota
	Production
)

type Message added in v0.1.3

type Message struct {
	Symbol      string `json:"symbol"`
	MessageType string `json:"messageType"`
	Data        Data   `json:"data"`
	Seq         int    `json:"seq"`
}

Message https://iexcloud.io/docs/api/#sse-streaming

type Parameters

type Parameters struct {
	Ticker           string   `json:"ticker,omitempty" url:",omitempty"`
	Symbols          []string `json:"symbols,omitempty" url:",omitempty"`
	Channels         []string `json:"channels,omitempty" url:",omitempty"`
	Endpoint         string   `json:"-" url:"-"`
	ChartIEXOnly     bool     `json:"chartIEXOnly,omitempty" url:",omitempty"`
	ChartReset       bool     `json:"chartReset,omitempty" url:",omitempty"`
	ChartSimplify    bool     `json:"chartSimplify,omitempty" url:",omitempty"`
	ChartInterval    int64    `json:"chartInterval,omitempty" url:",omitempty"`
	ChangeFromClose  bool     `json:"changeFromClose,omitempty" url:",omitempty"`
	ChartLast        int64    `json:"chartLast,omitempty" url:",omitempty"`
	ExactDate        string   `json:"exactDate,omitempty" url:",omitempty"`
	ChartIEXWhenNull bool     `json:"chartIEXWhenNull,omitempty" url:",omitempty"`
}

Parameters possible for an IEXCloud API request.

type ResponseIntradayPrices added in v0.1.9

type ResponseIntradayPrices []struct {
	Date                 string  `json:"date"`
	Minute               string  `json:"minute"`
	Label                string  `json:"label"`
	MarketOpen           float64 `json:"marketOpen"`
	MarketClose          float64 `json:"marketClose"`
	MarketHigh           float64 `json:"marketHigh"`
	MarketLow            float64 `json:"marketLow"`
	MarketAverage        float64 `json:"marketAverage"`
	MarketVolume         int     `json:"marketVolume"`
	MarketNotional       float64 `json:"marketNotional"`
	MarketNumberOfTrades int     `json:"marketNumberOfTrades"`
	MarketChangeOverTime float64 `json:"marketChangeOverTime"`
	High                 float64 `json:"high"`
	Low                  float64 `json:"low"`
	Open                 float64 `json:"open"`
	Close                float64 `json:"close"`
	Average              float64 `json:"average"`
	Volume               int     `json:"volume"`
	Notional             float64 `json:"notional"`
	NumberOfTrades       int     `json:"numberOfTrades"`
	ChangeOverTime       float64 `json:"changeOverTime"`
}

ResponseIntradayPrices https://iexcloud.io/docs/api/#intraday-prices

type ResponseLast added in v0.1.7

type ResponseLast []struct {
	Symbol string  `json:"symbol"`
	Price  float64 `json:"price"`
	Size   int     `json:"size"`
	Time   int64   `json:"time"`
}

ResponseLast https://iexcloud.io/docs/api/#last

func IntradayPrices added in v0.1.9

func IntradayPrices(parameters *Parameters) (response ResponseLast, _ error)

IntradayPrices https://iexcloud.io/docs/api/#intraday-prices

func Last added in v0.1.7

func Last(parameters *Parameters) (response ResponseLast, _ error)

Last https://iexcloud.io/docs/api/#Last

func Price added in v0.1.9

func Price(parameters *Parameters) (response ResponseLast, _ error)

Price https://iexcloud.io/docs/api/#price-only

type ResponsePrice added in v0.1.9

type ResponsePrice float64

ResponsePrice https://iexcloud.io/docs/api/#price-only

type ResponseQuote added in v0.1.7

type ResponseQuote struct {
	Symbol                 string  `json:"symbol"`
	CompanyName            string  `json:"companyName"`
	CalculationPrice       string  `json:"calculationPrice"`
	Open                   float64 `json:"open"`
	OpenTime               int64   `json:"openTime"`
	Close                  float64 `json:"close"`
	CloseTime              int64   `json:"closeTime"`
	High                   float64 `json:"high"`
	Low                    float64 `json:"low"`
	LatestPrice            float64 `json:"latestPrice"`
	LatestSource           string  `json:"latestSource"`
	LatestTime             string  `json:"latestTime"`
	LatestUpdate           int64   `json:"latestUpdate"`
	LatestVolume           int     `json:"latestVolume"`
	Volume                 int     `json:"volume"`
	IexRealtimePrice       float64 `json:"iexRealtimePrice"`
	IexRealtimeSize        int     `json:"iexRealtimeSize"`
	IexLastUpdated         int64   `json:"iexLastUpdated"`
	DelayedPrice           float64 `json:"delayedPrice"`
	DelayedPriceTime       int64   `json:"delayedPriceTime"`
	OddLotDelayedPrice     float64 `json:"oddLotDelayedPrice"`
	OddLotDelayedPriceTime int64   `json:"oddLotDelayedPriceTime"`
	ExtendedPrice          float64 `json:"extendedPrice"`
	ExtendedChange         float64 `json:"extendedChange"`
	ExtendedChangePercent  float64 `json:"extendedChangePercent"`
	ExtendedPriceTime      int64   `json:"extendedPriceTime"`
	PreviousClose          float64 `json:"previousClose"`
	PreviousVolume         int     `json:"previousVolume"`
	Change                 float64 `json:"change"`
	ChangePercent          float64 `json:"changePercent"`
	IexMarketPercent       float64 `json:"iexMarketPercent"`
	IexVolume              int     `json:"iexVolume"`
	AvgTotalVolume         int     `json:"avgTotalVolume"`
	IexBidPrice            float64 `json:"iexBidPrice"`
	IexBidSize             int     `json:"iexBidSize"`
	IexAskPrice            float64 `json:"iexAskPrice"`
	IexAskSize             int     `json:"iexAskSize"`
	MarketCap              int64   `json:"marketCap"`
	Week52High             float64 `json:"week52High"`
	Week52Low              float64 `json:"week52Low"`
	YtdChange              float64 `json:"ytdChange"`
	PeRatio                float64 `json:"peRatio"`
	LastTradeTime          int64   `json:"lastTradeTime"`
	IsUSMarketOpen         bool    `json:"isUSMarketOpen"`
}

ResponseQuote https://iexcloud.io/docs/api/#quote

func Quote added in v0.1.7

func Quote(parameters *Parameters) (response ResponseQuote, _ error)

Quote https://iexcloud.io/docs/api/#quote

Jump to

Keyboard shortcuts

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