quotegetter

package
v0.0.0-...-fdc35f2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClient

func DefaultClient(proxy string) (*http.Client, error)

DefaultClient xxx

func DoHTTPRequest

func DoHTTPRequest(client *http.Client, req *http.Request) (*http.Response, error)

DoHTTPRequest executes the http request.

func NewError

func NewError(source, isin, url string, err error) error

NewError creates a new *jsonGetterError

func NormalizeCurrency

func NormalizeCurrency(currency string) string

NormalizeCurrency return the standard ISO4217 representation of the known currency

Types

type Error

type Error interface {
	Source() string
	Isin() string
	URL() string
	Error() string
	Unwrap() error
}

Error is the interface that must be matched by all quotegetter errors

type QuoteGetter

type QuoteGetter interface {
	Source() string
	Client() *http.Client
	GetQuote(ctx context.Context, isin, url string) (*Result, error)
}

QuoteGetter interface

type Result

type Result struct {
	Source   string
	Isin     string
	URL      string
	Price    float32
	Currency string
	Date     time.Time
}

Result represents the info returned by the GetQuote function

Directories

Path Synopsis
jsons

Jump to

Keyboard shortcuts

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