types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceBCV = "BCV" // https://www.bcv.org.ve/
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency string
const (
	CurrencyUSD  Currency = "USD"
	CurrencyEUR  Currency = "EUR"
	CurrencyCNY  Currency = "CNY"
	CurrencyTRY  Currency = "TRY"
	CurrencyRUB  Currency = "RUB"
	CurrencyVES  Currency = "VES"
	CurrencyUSDT Currency = "USDT"
)

func (Currency) String

func (c Currency) String() string

type ExchangeRate

type ExchangeRate struct {
	AsOf      time.Time `json:"as_of"`
	FetchedAt time.Time `json:"fetched_at"`
	Base      Currency  `json:"base"`
	Target    Currency  `json:"target"`
	RateType  RateType  `json:"rate_type"`
	Source    Source    `json:"source"`
	Rate      float64   `json:"rate"`
}

type Page

type Page[T any] struct {
	Results []T   `json:"results"`
	Total   int64 `json:"total"`
}

Page wraps the results for pagination

type Pair

type Pair struct {
	Base   Currency `json:"base"`
	Target Currency `json:"target"`
}

type RateQuery

type RateQuery struct {
	Target   *Currency `json:"target"`
	RateType *RateType `json:"rate_type"`
	Source   *Source   `json:"source"`
	Base     Currency  `json:"base"`
	Offset   int64     `json:"offset"`
	Limit    int32     `json:"limit"`
}

type RateType

type RateType string
const (
	RateTypeMID  RateType = "MID"
	RateTypeBUY  RateType = "BUY"
	RateTypeSELL RateType = "SELL"
)

func (RateType) String

func (r RateType) String() string

type Source

type Source string

func (Source) String

func (s Source) String() string

Jump to

Keyboard shortcuts

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