diff --git a/config/redis.go b/config/redis.go deleted file mode 100644 index 244b2b07..00000000 --- a/config/redis.go +++ /dev/null @@ -1,19 +0,0 @@ -package config - -import "github.com/spf13/viper" - -type RedisConn struct { - Addr string - Password string - DB int -} - -func InitRedisConn(cfg *viper.Viper) *RedisConn { - return &RedisConn{ - Addr: cfg.GetString("addr"), - Password: cfg.GetString("password"), - DB: cfg.GetInt("db"), - } -} - -var RedisConnConfig = new(RedisConn) diff --git a/config/settings.yml.example b/config/settings.yml.example deleted file mode 100644 index 996cd4a4..00000000 --- a/config/settings.yml.example +++ /dev/null @@ -1,24 +0,0 @@ -settings: - application: - env: dev - envmsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600" - host: 0.0.0.0 - isinit: true - jwtsecret: 123abc - logpath: temp/logs/log.log - name: go-admin - port: 8000 - readtimeout: 1 - writertimeout: 2 - database: - database: dbname - dbtype: mysql - host: 127.0.0.1 - password: password - port: 3306 - username: root - redis: - addr: 0.0.0.0:6379 - db: 0 - password: password - readtimeout: 50 \ No newline at end of file diff --git a/handler/radisconn.go b/handler/radisconn.go deleted file mode 100644 index 1bee7fd0..00000000 --- a/handler/radisconn.go +++ /dev/null @@ -1,22 +0,0 @@ -package handler - -import ( - "github.com/go-redis/redis" - "go-admin/config" -) - -var RedisClient = new(redis.Client) - -func init() { - RedisNewClient(config.RedisConnConfig.Addr, config.RedisConnConfig.Password, config.RedisConnConfig.DB) -} - -func RedisNewClient(addr string, password string, db int) { - //timeout := time.Duration(readTimeout) - RedisClient = redis.NewClient(&redis.Options{ - Addr: addr, - Password: password, // no password set - DB: db, // use default DB - //ReadTimeout: , - }) -}