-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
98 lines (81 loc) · 2.1 KB
/
types.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package riksbank
import (
"time"
"github.com/zeeraw/riksbank/currency"
"github.com/zeeraw/riksbank/period"
)
// RateGroup represents a group for a rate
type RateGroup struct {
ID string
Name string
}
// RateSeries represents a series for a rate
type RateSeries struct {
ID string
Name string
}
// Rate represents a interest or exchange series rate for a period
type Rate struct {
Group RateGroup
Series RateSeries
Date time.Time
Period period.Period
Value *float64
}
// Rates represents multiple instances of Rate
type Rates []Rate
// Day represents information about a specific day in banking context
type Day struct {
Date time.Time
Year int
Week int
IsBankDay bool
}
// Days represents multiple instances of Day
type Days []Day
// Group represents information about an interest and exchange rate grouping
type Group struct {
ID string
ParentID string
Name string
Description string
}
// Groups represents multiple instances of Group
type Groups []Group
// ExchangeRate represents an exchange rate between two currencies
type ExchangeRate struct {
Date time.Time
Period period.Period
Base currency.Currency
Counter currency.Currency
Value *float64
}
// ExchangeRates represents multiple instance of ExchangeRate
type ExchangeRates []ExchangeRate
// ExchangeCurrency represents the exchange information for a currency
type ExchangeCurrency struct {
SeriesID string
Code string
Currency currency.Currency
Description string
}
// ExchangeCurrencies represents multiple instances of ExchangeCurrency
type ExchangeCurrencies []ExchangeCurrency
// Series represents information about a series
type Series struct {
ID string
GroupID string
Name string
Description string
LongDescription string
Source string
From time.Time
To time.Time
}
// SeriesGroup represents a group of series and information about the group
type SeriesGroup struct {
Group Group
Series []Series
}
// SeriesGroups represent multiple instances of SeriesGroup
type SeriesGroups []SeriesGroup