services

package
v0.0.0-...-df1b72c Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoldPriceOrgBaseURL = "https://data-asg.goldprice.org/dbXRates"
)

Variables

View Source
var (
	PreferredCurrency = "USD"
)

Functions

This section is empty.

Types

type GoldPrice

type GoldPrice struct {
	Currency      string    `json:"curr"`
	Price         float64   `json:"xauPrice"`
	Change        float64   `json:"chgXau"`
	PreviousClose float64   `json:"xauCLose"`
	Time          time.Time `json:"-"`
}

type GoldPriceClient

type GoldPriceClient interface {
	Get() (*GoldPrice, error)
}

func NewHTTPGoldPriceClient

func NewHTTPGoldPriceClient(baseURL string, client *http.Client, currency string) GoldPriceClient

type GoldPrices

type GoldPrices struct {
	Prices []GoldPrice `json:"items"`
}

type HTTPGoldPriceClient

type HTTPGoldPriceClient struct {
	GoldPriceClient
	// contains filtered or unexported fields
}

func (*HTTPGoldPriceClient) Get

func (g *HTTPGoldPriceClient) Get() (*GoldPrice, error)

Jump to

Keyboard shortcuts

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