aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Lawrence <scott+git@ineffectivetheory.com>2024-06-21 22:04:47 -0600
committerScott Lawrence <scott+git@ineffectivetheory.com>2024-06-21 22:04:47 -0600
commitcd972df86d691f9e514fca74651f12dae87b24f8 (patch)
treebd93b6932cff4efd3b09ae8e304dcdd09e0f93fb
parent1c3897db6d17973a66985bb6fc0c3cac0e13a5e5 (diff)
downloadvatic-cd972df86d691f9e514fca74651f12dae87b24f8.tar.gz
vatic-cd972df86d691f9e514fca74651f12dae87b24f8.tar.bz2
vatic-cd972df86d691f9e514fca74651f12dae87b24f8.zip
First part of the data-downloading infrastructure
-rw-r--r--Project.toml1
-rw-r--r--src/Data.jl27
2 files changed, 28 insertions, 0 deletions
diff --git a/Project.toml b/Project.toml
index 430531c..9a7177e 100644
--- a/Project.toml
+++ b/Project.toml
@@ -5,6 +5,7 @@ version = "0.1.0"
[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
+Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
diff --git a/src/Data.jl b/src/Data.jl
index c1323b6..951a1b2 100644
--- a/src/Data.jl
+++ b/src/Data.jl
@@ -1,5 +1,32 @@
module Data
+using Downloads: download
using TOML
+import Base: getindex, setindex
+
+struct Source
+end
+
+struct Index
+ filename::String
+ sources::Dict{String, Source}
+end
+
+function Index(filename::String)::Index
+ sources = Dict{String, Source}()
+ return Index(filename, sources)
+end
+
+function save(index::Index)
+end
+
+function getindex(index::Index, k::String)::Source
+ index.sources[k]
+end
+
+function setindex!(index::Index, k::String, s::Source)
+ index.sources[k] = s
+end
+
end