Documentation
¶
Index ¶
- type Client
- func (c *Client) GetLastForexQuote(ctx context.Context, params *models.GetLastForexQuoteParams, ...) (*models.GetLastForexQuoteResponse, error)
- func (c *Client) GetLastQuote(ctx context.Context, params *models.GetLastQuoteParams, ...) (*models.GetLastQuoteResponse, error)
- func (c *Client) ListQuotes(ctx context.Context, params *models.ListQuotesParams, ...) *ListQuotesIter
- type ListQuotesIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client defines a REST client for the Polygon quotes API.
func (*Client) GetLastForexQuote ¶
func (c *Client) GetLastForexQuote(ctx context.Context, params *models.GetLastForexQuoteParams, options ...models.RequestOption) (*models.GetLastForexQuoteResponse, error)
GetLastForexQuote retrieves the last quote (BBO) for a forex currency pair. For more details see https://polygon.io/docs/forex/get_v1_last_quote_currencies__from___to.
func (*Client) GetLastQuote ¶
func (c *Client) GetLastQuote(ctx context.Context, params *models.GetLastQuoteParams, options ...models.RequestOption) (*models.GetLastQuoteResponse, error)
GetLastQuote retrieves the last quote (NBBO) for a specified ticker. For more details see https://polygon.io/docs/stocks/get_v2_last_nbbo__stocksticker.
func (*Client) ListQuotes ¶
func (c *Client) ListQuotes(ctx context.Context, params *models.ListQuotesParams, options ...models.RequestOption) *ListQuotesIter
ListQuotes retrieves quotes for a specified ticker. For more details see https://polygon.io/docs/stocks/get_v3_quotes__stockticker. This method returns an iterator that should be used to access the results via this pattern:
iter, err := c.ListQuotes(context.TODO(), params, opts...)
for iter.Next() {
// do something with the current value
log.Print(iter.Quote())
}
if iter.Err() != nil {
return err
}
type ListQuotesIter ¶
ListQuotesIter is an iterator for the ListQuotes method.
func (*ListQuotesIter) Quote ¶
func (it *ListQuotesIter) Quote() models.Quote
Quote returns the current result that the iterator points to.