client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIURL            = "https://api.polygon.io"
	DefaultRetryCount = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP *resty.Client
	// contains filtered or unexported fields
}

Client defines an HTTP client for the Polygon REST API.

func New

func New(apiKey string) Client

New returns a new client with the specified API key and default settings.

func NewWithClient

func NewWithClient(apiKey string, hc *http.Client) Client

NewWithClient returns a new client with the specified API key and a custom HTTP client.

func (*Client) Call

func (c *Client) Call(ctx context.Context, method, path string, params, response any, opts ...models.RequestOption) error

Call makes an API call based on the request params and options. The response is automatically unmarshaled.

func (*Client) CallURL

func (c *Client) CallURL(ctx context.Context, method, uri string, response any, opts ...models.RequestOption) error

CallURL makes an API call based on a request URI and options. The response is automatically unmarshaled.

Jump to

Keyboard shortcuts

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