Documentation ¶
Overview ¶
Package nbggovge provides functionality for fetching currency rates from nbg.gov.ge API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCodeNotFound = errors.New("code not found in set")
ErrCodeNotFound returned when specified code could not be found in set.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Rates returns ratesResponse for today by default for a list of currency codes set up by options. Rates(ctx context.Context, opts ...option.RatesOption) (Rates, error) }
Client is a contract for nbg.gov.ge API.
func NewWithHTTPClient ¶
func NewWithHTTPClient(c HTTPClient) Client
NewWithHTTPClient returns nbg.gov.ge API client with specified http client.
type Currency ¶
type Currency struct { Code string `json:"code"` Quantity int64 `json:"quantity"` RateFormated string `json:"rateFormated"` DiffFormated string `json:"diffFormated"` Rate float64 `json:"rate"` Name string `json:"name"` Diff float64 `json:"diff"` Date string `json:"date"` ValidFromDate string `json:"validFromDate"` }
Currency represents rates for one currency.
type HTTPClient ¶
HTTPClient is and interface for mocking sending http requests.
Directories ¶
Path | Synopsis |
---|---|
Package currencies contains currency codes constants.
|
Package currencies contains currency codes constants. |
Package internal holds internal logic and parameters for requests.
|
Package internal holds internal logic and parameters for requests. |
Package mock provides mock implementations of nbggovge.Client.
|
Package mock provides mock implementations of nbggovge.Client. |
Package option represents options pattern for Rates request.
|
Package option represents options pattern for Rates request. |
Click to show internal directories.
Click to hide internal directories.