-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.go
51 lines (45 loc) · 823 Bytes
/
variables.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gomoney
import (
"errors"
"github.com/gsingharoy/onecache"
)
// Standard currency values supported by the library
var supportedCurrencies = map[string]bool{
"EUR": true,
"USD": true,
"JPY": true,
"BGN": true,
"CZK": true,
"DKK": true,
"GBP": true,
"HUF": true,
"PLN": true,
"RON": true,
"SEK": true,
"CHF": true,
"NOK": true,
"HRK": true,
"RUB": true,
"TRY": true,
"AUD": true,
"BRL": true,
"CAD": true,
"CNY": true,
"HKD": true,
"IDR": true,
"ILS": true,
"INR": true,
"KRW": true,
"MXN": true,
"MYR": true,
"NZD": true,
"PHP": true,
"SGD": true,
"THB": true,
"ZAR": true,
}
// inmemory cache
var cache = onecache.New()
// Define all errors here
var ErrUnsupportedCurrency = errors.New("unsupported currency")
var ErrInvalidMoneyObject = errors.New("missing exchange rates")