From c807d0221b3c3ddbee2177f7985d811c8c47d870 Mon Sep 17 00:00:00 2001 From: bruce Date: Thu, 8 Jun 2023 21:13:27 +0800 Subject: [PATCH] feat(all): remove settings from Instance. --- settings.go | 58 ----------------------------------------------------- uzsdk.go | 1 - 2 files changed, 59 deletions(-) delete mode 100644 settings.go diff --git a/settings.go b/settings.go deleted file mode 100644 index 7cce9b2..0000000 --- a/settings.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2023 nanzoom.com. All Rights Reserved. - -package uzsdk - -// Setting defines application's configuration. -type Setting struct { - Service struct { - IP string // server listen address:ip, default: 0.0.0.0 - Port int64 // server listen address:port, default: 9000 - ServerName string // local address served by this server, default: http://[IP]:[Port], exp: http://127.0.0.1:9000 - SystemName string // smartsystem address served by httpd, default: http://[IP], exp: http://192.168.0.6 - PublicName string // smartcloud address served by httpd, default: [ServerName], exp: http://192.168.0.6:8080 - ServicePath string // urlpath for this service, default: /wservice - DataDirectory string // server data directory, default: /data/cloud - TrustedProxies []string // a list of proxies trusted, default: ["127.0.0.1"] - } - System struct { - DBDriver string // database driver, default: postgres - DBHost string // database host, default: 127.0.0.1 - DBPort int64 // database port, default: 5432 - DBUser string // database user, default: postgres - DBPassword string // database password, default: postgres - DBName string // database name, default: serverdb - Heartbeat int64 // heartbeat(unit: second) for keepalive between client and server, default: 36000 - IdleTime int64 // server kick off client those do nothing after this idle time, default: [Heartbeat]<<2 - CheckTime int64 // interval that server check client status, default: [Heartbeat]>>1 - DbgOutput bool // debug: output more details, default: fasle. - DbgToken bool // debug: use token '63886e35-7291-4b4d-a66f-fa7431542ace', default: false - } - GZip struct { - Enable bool // enable gzip with gin, default: true - Level int64 // gzip compress level, default: gzip.DefaultCompression - } - Logging struct { - Level string // TODO: log level, default: error - Prefix string // prefix add to each log message, default: "" - File struct { - Name string // log filename - } - Syslog struct { - Enable bool // TODO: enable log to system, default: false - } - } - Wechat struct { - // for wechat-app - Appid string - Appsecret string - // for wechat-pay - Mchid string - Apikey string - CertificateSerialno string - PrivateKeyPath string - NotifyUrl string - } - Task struct { - Timeout int64 - } -} diff --git a/uzsdk.go b/uzsdk.go index 6ccadd5..10f9edf 100644 --- a/uzsdk.go +++ b/uzsdk.go @@ -129,7 +129,6 @@ func Respcode(code string, options ...interface{}) Respnode { // Instance is the framework's instance, used for server & plugin both. type Instance struct { - Setting *Setting // settings of this application. Db *sqlx.DB // the first database connection created by main routine. Logger *logger.Logger // logger created by main routine. Router *gin.Engine // default webservice engine created by main routine. -- 2.43.5