alpha

package
v0.0.0-...-988b7e1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAndDecode

func GetAndDecode(ctx context.Context, httpClient *http.Client, endpoint string, dst interface{}) error

GetAndDecode creates a new HTTP request with a Context using the passed in endpoint url The body is then JSON decoded to the dst pointer passed in

Types

type Client

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

func NewClient

func NewClient(baseUrl, token string) *Client

NewClient creates a new Alpha Vantage client using a baseUrl and the token

func (*Client) EconomicData

func (c *Client) EconomicData(ctx context.Context, reportType ReportType, opts *Options) (*data.EconomicResponse, error)

EconomicData Gets the monthly manufacturers' new orders of durable goods in the United States.

func (*Client) WithBaseUrl

func (c *Client) WithBaseUrl(url string) *Client

WithBaseUrl overrides the baseUrl

func (*Client) WithHttpClient

func (c *Client) WithHttpClient(httpClient *http.Client) *Client

WithHttpClient overrides the httpClient

type Interval

type Interval int8
const (
	Daily Interval = iota + 1
	Monthly
	Quarterly
	SemiAnnual
	Annual
)

func (Interval) String

func (c Interval) String() string

type Maturity

type Maturity int8
const (
	ThreeMonth Maturity = iota + 1
	TwoYear
	FiveYear
	SevenYear
	TenYear
	ThirtyYear
)

func (Maturity) String

func (c Maturity) String() string

type Options

type Options struct {
	Interval Interval `url:"interval"`
	Maturity Maturity `url:"maturity"`
}

type ReportType

type ReportType int
const (
	CPI ReportType = iota
	CONSUMER_SENTIMENT
	TREASURY_YIELD
	RETAIL_SALES
	REAL_GDP
	REAL_GDP_PER_CAPITA
	FED_FUNDS_RATE
	DURABLE_GOODS
	UNEMPLOYMENT
	NONFARM_PAYROLL
	INFLATION
	INFLATION_EXPECTATION
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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