From: bruce Date: Thu, 8 Jun 2023 13:13:27 +0000 (+0800) Subject: feat(all): remove settings from Instance. X-Git-Tag: v0.1.0 X-Git-Url: https://git.uzoombox.com/git/?a=commitdiff_plain;h=f9d128a176a65155319837d019fd55328ff75ea7;p=uzsdk-v0.3.0.git feat(all): remove settings from Instance. --- 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.