summaryrefslogtreecommitdiffhomepage
path: root/src/mintage/mintage.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-06-06 01:32:41 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-06-06 01:32:41 +0200
commit2c726e551d90d20bcd2d78545c369864cc9038e5 (patch)
tree520615a33c966c729e70e549e859a2c01dc4ba40 /src/mintage/mintage.go
parent9379ea42a9b0afd1abf705bf3300f03d8bbe79f9 (diff)
Use CSV’s for mintages
Diffstat (limited to 'src/mintage/mintage.go')
-rw-r--r--src/mintage/mintage.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/mintage/mintage.go b/src/mintage/mintage.go
new file mode 100644
index 0000000..cc94de7
--- /dev/null
+++ b/src/mintage/mintage.go
@@ -0,0 +1,40 @@
+package mintage
+
+type Data struct {
+ Standard []SRow
+ Commemorative []CRow
+}
+
+type SRow struct {
+ Year int
+ Mintmark string
+ Mintages [denoms]int
+}
+
+type CRow struct {
+ Year int
+ Name string
+ Mintmark string
+ Mintage int
+}
+
+const (
+ TypeCirc = iota
+ TypeNifc
+ TypeProof
+)
+
+const (
+ Unknown = -iota - 1
+ Invalid
+)
+
+const denoms = 8
+
+var cache map[string][3]Data = make(map[string][3]Data)
+
+func ClearCache(country string) {
+ if _, ok := cache[country]; ok {
+ delete(cache, country)
+ }
+}