lib

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const GetResultDateFormat = "02/01/2006"

Variables

This section is empty.

Functions

This section is empty.

Types

type GetQuery

type GetQuery struct {
	Symbol   string
	From     string
	Duration string
	Period   string
}

func (GetQuery) Validate

func (q GetQuery) Validate() (GetQuery, error)

type GetResult

type GetResult struct {
	Date  GetResultDate `json:"date"`
	Price float64       `json:"price"`
}

type GetResultDate

type GetResultDate struct {
	time.Time
}

func (GetResultDate) MarshalJSON

func (d GetResultDate) MarshalJSON() ([]byte, error)

Format date to JSON

type GetResults

type GetResults []GetResult

func Get

func Get(unsafeQuery GetQuery) (GetResults, error)

func (GetResults) Len

func (q GetResults) Len() int

Implement Sort interface

func (GetResults) Less

func (q GetResults) Less(i, j int) bool

func (GetResults) Swap

func (q GetResults) Swap(i, j int)

type SearchQuery

type SearchQuery struct {
	Value string
	Page  uint16
}

func (SearchQuery) Validate

func (q SearchQuery) Validate() (SearchQuery, error)

type SearchResult

type SearchResult struct {
	Page       uint16              `json:"current_page"`
	TotalPages uint16              `json:"total_pages_count"`
	Assets     []SearchResultAsset `json:"values"`
}
func Search(unsafeQuery SearchQuery) (SearchResult, error)

type SearchResultAsset added in v1.4.0

type SearchResultAsset struct {
	Symbol    string `json:"symbol"`
	LastPrice string `json:"last_price"`
	Market    string `json:"market"`
	Name      string `json:"name"`
}

Directories

Path Synopsis
options
get

Jump to

Keyboard shortcuts

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