-
Notifications
You must be signed in to change notification settings - Fork 1
/
currency_model.go
48 lines (41 loc) · 1.05 KB
/
currency_model.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
package nbpapi
import "net/http"
// NBPCurrency type
type NBPCurrency struct {
tableType string
result []byte
Exchange exchangeCurrency
ExchangeC exchangeCurrencyC
Client *http.Client
}
type rateCurrency struct {
No string `json:"no"`
EffectiveDate string `json:"effectiveDate"`
Mid float64 `json:"mid"`
}
type exchangeCurrency struct {
Table string `json:"table"`
Currency string `json:"currency"`
Code string `json:"code"`
Rates []rateCurrency `json:"rates"`
}
type rateCurrencyC struct {
No string `json:"no"`
EffectiveDate string `json:"effectiveDate"`
Bid float64 `json:"bid"`
Ask float64 `json:"ask"`
}
type exchangeCurrencyC struct {
Table string `json:"table"`
Currency string `json:"currency"`
Code string `json:"code"`
Rates []rateCurrencyC `json:"rates"`
}
// Rate type
type Rate struct {
No string
EffectiveDate string
Mid float64
Bid float64
Ask float64
}