diff --git a/pkg/config/config.go b/pkg/config/config.go index c4468fadca744aaf350932f4a2a3b6c908258345..498bd82dc901379c55902a4be2dd79d6db69523c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -78,13 +78,13 @@ func Init(output io.Writer, configFile string) error { } viper.WatchConfig() viper.OnConfigChange(func(e fsnotify.Event) { - _, _ = fmt.Fprintf(output, "Config file changed %s \n", e.Name) + fmt.Fprintf(output, "Config file changed %s \n", e.Name) }) return nil } func MustInit(output io.Writer, conf string) { // MustInit if fail panic if err := Init(output, conf); err != nil { - panic(fmt.Errorf("Fatal error config file: %s \n", err)) + panic(fmt.Errorf("fatal error config file: %s", err)) } } diff --git a/pkg/config/dev.yaml.templete b/pkg/config/dev.yaml.templete deleted file mode 100644 index acebcbadc6d82466626e9db5031f7123cd11e148..0000000000000000000000000000000000000000 --- a/pkg/config/dev.yaml.templete +++ /dev/null @@ -1,16 +0,0 @@ -server: - port: ":8083" -db: - ip: 192.168.160.18 - port: 3306 - username: "name" - password: "password" - dbname: pilotgo -log_opts: - log_level: "debug" - log_driver: "stdout" - log_path: "./log" - max_file: 1 - max_size: 10485760 -max_age: 1800, -session_count: 100 diff --git a/pkg/configure/config.go b/pkg/configure/config.go deleted file mode 100644 index 29bdcaf82ba5fa109abd4bd5b1bd9f36d9a5212a..0000000000000000000000000000000000000000 --- a/pkg/configure/config.go +++ /dev/null @@ -1,20 +0,0 @@ -package configure - -//import ( -// "github.com/spf13/viper" -//) -// -//const default_config_path = "config.yaml" -// -//type Config struct { -// v *viper.Viper -// configMap map[string]string -//} -// -//func (c *Config) Load() { -// -//} -// -//func (c *Config) Get(path string) string { -// return "" -//} diff --git a/pkg/configure/configure.go b/pkg/configure/configure.go deleted file mode 100644 index 6acf1325a1837d0629bf82f02fa6e644d7ba6875..0000000000000000000000000000000000000000 --- a/pkg/configure/configure.go +++ /dev/null @@ -1,51 +0,0 @@ -package configure - -//import ( -// "encoding/json" -// "fmt" -// "io/ioutil" -//) -// -//var pilogo_config_file_name = "./config.json" -// -//type LogOpts struct { -// LogLevel string `json:"log_level"` -// LogDriver string `json:"log_driver"` -// LogPath string `json:"log_path"` -// MaxFile int `json:"max_file"` -// MaxSize int `json:"max_size"` -//} -//type Server struct { -// ServerPort int `json:"server_port"` -//} -//type DbInfo struct { -// HostName string `json:"host_name"` -// UserName string `json:"user_name"` -// Password string `json:"password"` -// DataBase string `json:"data_base"` -// Port int `json:"port"` -//} -// -//type Configure struct { -// Logopts LogOpts `json:"log_opts"` -// S Server `json:"server"` -// MaxAge int `json:"max_age"` -// SessionCount int `json:"session_count"` -// Dbinfo DbInfo `json:"db_info"` -//} -// -//func Load() (*Configure, error) { -// var config Configure -// bytes, err := ioutil.ReadFile(pilogo_config_file_name) -// if err != nil { -// fmt.Printf("open %s failed! err = %s\n", pilogo_config_file_name, err.Error()) -// return nil, err -// } -// -// err = json.Unmarshal(bytes, &config) -// if err != nil { -// fmt.Printf("json.Unmarshal %s failed!\n", string(bytes)) -// return nil, err -// } -// return &config, nil -//}