Documentation ¶
Index ¶
- type HistoryRequest
- type HistoryResponse
- type Order
- type OrderBookRequest
- type OrderBookResponse
- type PriceRequest
- type PriceResponse
- type QuoteRequest
- type QuoteResponse
- type StockService
- func (t *StockService) History(request *HistoryRequest) (*HistoryResponse, error)
- func (t *StockService) OrderBook(request *OrderBookRequest) (*OrderBookResponse, error)
- func (t *StockService) Price(request *PriceRequest) (*PriceResponse, error)
- func (t *StockService) Quote(request *QuoteRequest) (*QuoteResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HistoryRequest ¶
type HistoryResponse ¶
type HistoryResponse struct { // the close price Close float64 `json:"close"` // the date Date string `json:"date"` // the peak price High float64 `json:"high"` // the low price Low float64 `json:"low"` // the open price Open float64 `json:"open"` // the stock symbol Symbol string `json:"symbol"` // the volume Volume int32 `json:"volume"` }
type OrderBookRequest ¶
type OrderBookRequest struct { // the date in format YYYY-MM-dd Date string `json:"date"` // optional RFC3339Nano end time e.g 2006-01-02T15:04:05.999999999Z07:00 End string `json:"end"` // limit number of prices Limit int32 `json:"limit"` // optional RFC3339Nano start time e.g 2006-01-02T15:04:05.999999999Z07:00 Start string `json:"start"` // stock to retrieve e.g AAPL Stock string `json:"stock"` }
type OrderBookResponse ¶
type PriceRequest ¶
type PriceRequest struct { // stock symbol e.g AAPL Symbol string `json:"symbol"` }
type PriceResponse ¶
type QuoteRequest ¶
type QuoteRequest struct { // the stock symbol e.g AAPL Symbol string `json:"symbol"` }
type QuoteResponse ¶
type QuoteResponse struct { // the asking price AskPrice float64 `json:"askPrice"` // the ask size AskSize int32 `json:"askSize"` // the bidding price BidPrice float64 `json:"bidPrice"` // the bid size BidSize int32 `json:"bidSize"` // the stock symbol Symbol string `json:"symbol"` // the UTC timestamp of the quote Timestamp string `json:"timestamp"` }
type StockService ¶
type StockService struct {
// contains filtered or unexported fields
}
func NewStockService ¶
func NewStockService(token string) *StockService
func (*StockService) History ¶
func (t *StockService) History(request *HistoryRequest) (*HistoryResponse, error)
Get the historic open-close for a given day
func (*StockService) OrderBook ¶
func (t *StockService) OrderBook(request *OrderBookRequest) (*OrderBookResponse, error)
Get the historic order book and each trade by timestamp
func (*StockService) Price ¶
func (t *StockService) Price(request *PriceRequest) (*PriceResponse, error)
Get the last price for a given stock ticker
func (*StockService) Quote ¶
func (t *StockService) Quote(request *QuoteRequest) (*QuoteResponse, error)
Get the last quote for the stock
Click to show internal directories.
Click to hide internal directories.