internal

package
v0.0.0-...-1da0ad8 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHttpMethod = errors.New("INVALID_HTTP_METHOD")
	ErrInvalidPayload    = errors.New("INVALID_PAYLOAD")
)

Functions

func ErrHttpError

func ErrHttpError(r *http.Response) error

Types

type Api

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

func NewApi

func NewApi() (*Api, error)

func (*Api) GetQuote

func (a *Api) GetQuote(symbol string) (*Quote, error)

func (*Api) GetQuoteWithHistory

func (a *Api) GetQuoteWithHistory(symbol string, date time.Time) (*Quote, error)

type Client

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

func (*Client) Get

func (c *Client) Get(url string) ([]byte, error)

func (*Client) Post

func (c *Client) Post(url string, body []byte) ([]byte, error)

type History

type History struct {
	Date  time.Time
	Price float64
}

type Quote

type Quote struct {
	Symbol  string
	Name    string
	Price   float64
	History *History
}

Jump to

Keyboard shortcuts

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