api

package
v0.0.0-...-f1e4ae4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Moscow Region = "moskva"

	USD CurrencyCode = "840"
	EUR CurrencyCode = "978"
	AED CurrencyCode = "784"
	BYN CurrencyCode = "933"
	CAD CurrencyCode = "124"
	CHF CurrencyCode = "756"
	CNY CurrencyCode = "156"
	GBP CurrencyCode = "826"
	HKD CurrencyCode = "344"
	JPY CurrencyCode = "392"
	KRW CurrencyCode = "410"
	KTZ CurrencyCode = "398"
	TRY CurrencyCode = "949"

	CurrencyCodeMap = map[string]CurrencyCode{
		"USD": USD,
		"EUR": EUR,
		"AED": AED,
		"BYN": BYN,
		"CAD": CAD,
		"CHF": CHF,
		"CNY": CNY,
		"GBP": GBP,
		"HKD": HKD,
		"JPY": JPY,
		"KRW": KRW,
		"KTZ": KTZ,
		"TRY": TRY,
	}
)
View Source
var (
	// Debug mode. Default: false.
	Debug bool
)

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Bank    string    `json:"bank"`
	Subway  string    `json:"subway"`
	Buy     float64   `json:"buy"`
	Sell    float64   `json:"sell"`
	Updated time.Time `json:"updated"`
}

type Branches

type Branches struct {
	Currency string   `json:"currency"`
	City     string   `json:"city"`
	Items    []Branch `json:"items"`
}

func (*Branches) String

func (r *Branches) String() string

String representation of cash currency exchange rates.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for banki.ru.

func NewClient

func NewClient() (*Client, error)

New creates a new client.

func (*Client) Branches

func (c *Client) Branches(city, currency string) (*Branches, error)

Branches returns branches info. By default, it returns branches in Moscow and currency USD.

type CurrencyCode

type CurrencyCode string

type Region

type Region string

Jump to

Keyboard shortcuts

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