diff options
author | xengineering <me@xengineering.eu> | 2024-05-01 13:07:08 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-05-01 13:07:08 +0200 |
commit | 409f612eb87418a5bff09d5e83a19ffc6f2306f6 (patch) | |
tree | 8c0aaa60780602aaa9cd0c49e67268c7a5358f9e /config.go | |
parent | c7c45837c60e526d66b3f6012cbeef36262bd2dc (diff) | |
download | ceres-409f612eb87418a5bff09d5e83a19ffc6f2306f6.tar ceres-409f612eb87418a5bff09d5e83a19ffc6f2306f6.tar.zst ceres-409f612eb87418a5bff09d5e83a19ffc6f2306f6.zip |
Implement parsing of embedded default config
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/config.go b/config.go new file mode 100644 index 0000000..f97f2a3 --- /dev/null +++ b/config.go @@ -0,0 +1,24 @@ +package main + +import ( + _ "embed" + "encoding/json" + "log" +) + +//go:embed default_config.json +var defaultConfig string + +type CeresConfig struct { + HttpAddress string `json:"http_address"` + StorageFilePath string `json:"storage_file_path"` +} + +var config CeresConfig + +func init() { + err := json.Unmarshal([]byte(defaultConfig), &config) + if err != nil { + log.Fatal(err) + } +} |