From 7d28febd359370f0cbf8194a23a7c0b5376a9559 Mon Sep 17 00:00:00 2001 From: Stefano Salvatori Date: Sun, 27 Dec 2020 00:17:08 +0100 Subject: [PATCH] Remove unused configuration --- README.md | 8 ++------ configuration.go | 14 ++------------ main_test.go | 9 ++------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index fe4c8a3..5fa9548 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ ## Setup -You **must** set the **ZBOT_CONFIG_FILE** environment variable with the path to the configuration file +You **must** set the environment variable **ZBOT_CONFIG_FILE** with the path to the configuration file * ZBOT_CONFIG_FILE : Path to the configuration file (default ./zbot.conf) +* ZBOT_LOG_LEVEL : Log verbosity (default info) ## Configuration File @@ -23,12 +24,7 @@ zbot: level: false db: engine: sqlite - name: db_name file: path_to_sqlite_file.db - host: 127.0.0.1 - port: 3306 - username: db_username - password: db_password commands: learn: disabled: diff --git a/configuration.go b/configuration.go index 18d7f39..bc0da7d 100644 --- a/configuration.go +++ b/configuration.go @@ -18,12 +18,7 @@ type Configuration struct { } `yaml:"zbot"` Db struct { Engine string `yaml:"engine"` - Name string `yaml:"name"` File string `yaml:"file"` - Host string `yaml:"host"` - Port int `yaml:"port"` - Username string `yaml:"username"` - Password string `yaml:"password"` } `yaml:"db"` Commands struct { Learn struct { @@ -67,13 +62,8 @@ type configurationZbot struct { } type configurationDb struct { - Engine string `yaml:"engine"` - Name string `yaml:"name"` - File string `yaml:"file"` - Host string `yaml:"host"` - Port int `yaml:"port"` - Username string `yaml:"username"` - Password string `yaml:"password"` + Engine string `yaml:"engine"` + File string `yaml:"file"` } type configurationLearn struct { diff --git a/main_test.go b/main_test.go index ce8ac2c..777a602 100644 --- a/main_test.go +++ b/main_test.go @@ -20,13 +20,8 @@ var confTest = Configuration{ Level: false, }, Db: configurationDb{ - Engine: "sqlite", - Name: "", - File: "", - Host: "", - Port: 1234, - Username: "test", - Password: "paswsword", + Engine: "sqlite", + File: "", }, Commands: configurationCommands{ Learn: configurationLearn{