index

package
v0.0.0-...-e21f18a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Http HTTPClient
}

func NewClient

func NewClient() *Client

func (*Client) Get

func (c *Client) Get(index string) (*Index, error)

Get returns information for a given index from a configured data source

type Component

type Component struct {
	Name   string  `json:"name"`
	Price  float64 `json:"lastPrice"`
	Rank   float64 `json:"rank"`
	Symbol string  `json:"symbol"`
	Weight float32 `json:"weight"`
	Value  float32 `json:"value"`
}

Component represents a position in an index

type DataSourceChanged

type DataSourceChanged struct {
	Message string
}

func (DataSourceChanged) Error

func (e DataSourceChanged) Error() string

type DataSourceUnavailable

type DataSourceUnavailable struct {
	Message string
}

func (DataSourceUnavailable) Error

func (e DataSourceUnavailable) Error() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Index

type Index struct {
	Components []Component `json:"companyList"`
}

Index represents a stcok index an index is made up of multiple companies (represented as components of the index)

type NotFound

type NotFound struct {
	Message string
}

func (NotFound) Error

func (e NotFound) Error() string

Jump to

Keyboard shortcuts

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