Add mapstructure for dbconfig in config.go

This commit is contained in:
Chen-I Lim 2020-10-13 22:14:08 -07:00
parent c218e5b637
commit 0b53e083dc

View file

@ -8,13 +8,13 @@ import (
// Configuration is the app configuration stored in a json file // Configuration is the app configuration stored in a json file
type Configuration struct { type Configuration struct {
ServerRoot string `json:"serverRoot"` ServerRoot string `json:"serverRoot" mapstructure:"serverRoot"`
Port int `json:"port"` Port int `json:"port" mapstructure:"port"`
DBType string `json:"dbtype"` DBType string `json:"dbtype" mapstructure:"dbtype"`
DBConfigString string `json:"dbconfig"` DBConfigString string `json:"dbconfig" mapstructure:"dbconfig"`
UseSSL bool `json:"useSSL"` UseSSL bool `json:"useSSL" mapstructure:"useSSL"`
WebPath string `json:"webpath"` WebPath string `json:"webpath" mapstructure:"webpath"`
FilesPath string `json:"filespath"` FilesPath string `json:"filespath" mapstructure:"filespath"`
} }
func readConfigFile() (*Configuration, error) { func readConfigFile() (*Configuration, error) {