From eb4fa0b799828d65ff5b7f17066a2afb5f82130f Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 24 Jul 2022 04:24:11 +0200 Subject: [PATCH] Explicitly set snake-case name for multi-word config keys --- .gitignore | 3 +++ internal/config/config.go | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 47df990..4fb2626 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ matrix-pretix + +*.json +*.sqlite3 diff --git a/internal/config/config.go b/internal/config/config.go index 8840205..bb5fead 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -16,17 +16,17 @@ type DatabaseConfig struct { } type MatrixConfig struct { - AllowedRooms []string - DisplayName string - LogLevel uint - HomeserverURL string - UserIdentifier string + AllowedRooms []string `json:"allowed_rooms"` + DisplayName string `json:"display_name"` + LogLevel uint `json:"log_level"` + HomeserverURL string `json:"homeserver_url"` + UserIdentifier string `json:"user_identififer"` Password string - PickleKey string + PickleKey string `json:"pickle_key"` } type ServerConfig struct { - ListenAddress string + ListenAddress string `json:"listen_address"` } func ParseFromFile(path string) (config *Config, err error) {