--- /dev/null
+// Copyright 2010-2022 nanzoom.com. All Rights Reserved.
+
+package types
+
+// Configuration defines application's configuration.
+type Configuration 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"]
+ }
+}
package uzsdk
import (
- "git.uzoombox.com/git/uzsdk/logger"
- "git.uzoombox.com/git/uzsdk/translations"
+ "git.uzoombox.com/git/uzsdk/components/logger"
+ "git.uzoombox.com/git/uzsdk/service/translations"
+ "git.uzoombox.com/git/uzsdk/service/types"
"github.com/gin-gonic/gin"
"github.com/jmoiron/sqlx"
)
// Respcode returns a structure of Respnode that message has been translated using language if options.language is set,
// else directly returns Respcode(code, ct.AdLanguage).
// options will be [language]:
-// language *string: name of language.
+//
+// language *string: name of language.
func Respcode(code string, options ...interface{}) Respnode {
var language *string = nil
for _, option := range options {
// Instance is the framework's instance, used for server & plugin both.
type Instance struct {
- 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.
- Maintenance bool // when maintenance mode is true, only serve api /config.
+ Conf *types.Configuration // configuration 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.
+ Maintenance bool // when maintenance mode is true, only serve api /config.
}
// Copyright 2023 nanzoom.com. All Rights Reserved.
+/* ## Package versions
+go 1.20
+
+require (
+ git.uzoombox.com/git/uzsdk v0.1.0
+ github.com/cavaliergopher/grab/v3 v3.0.1
+ github.com/chromedp/cdproto v0.0.0-20230611221135-4cd95c996604
+ github.com/chromedp/chromedp v0.9.1
+ github.com/cstockton/go-conv v1.0.0
+ github.com/fatih/structs v1.1.0
+ github.com/gin-contrib/gzip v0.0.6
+ github.com/gin-gonic/gin v1.9.1
+ github.com/huandu/go-sqlbuilder v1.21.0
+ github.com/jmoiron/sqlx v1.3.5
+ github.com/json-iterator/go v1.1.12
+ github.com/lib/pq v1.10.9
+ github.com/mafredri/cdp v0.34.1
+ github.com/pdfcpu/pdfcpu v0.4.1
+ github.com/spaolacci/murmur3 v1.1.0
+ github.com/wechatpay-apiv3/wechatpay-go v0.2.16
+ golang.org/x/sys v0.8.0
+)
+
+require (
+ github.com/bytedance/sonic v1.9.1 // indirect
+ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
+ github.com/chromedp/sysutil v1.0.0 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.2 // indirect
+ github.com/gin-contrib/sse v0.1.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.14.0 // indirect
+ github.com/gobwas/httphead v0.1.0 // indirect
+ github.com/gobwas/pool v0.2.1 // indirect
+ github.com/gobwas/ws v1.1.0 // indirect
+ github.com/goccy/go-json v0.10.2 // indirect
+ github.com/gorilla/websocket v1.4.2 // indirect
+ github.com/hhrutter/lzw v1.0.0 // indirect
+ github.com/hhrutter/tiff v1.0.0 // indirect
+ github.com/huandu/xstrings v1.3.2 // indirect
+ github.com/josharian/intern v1.0.0 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.4 // indirect
+ github.com/leodido/go-urn v1.2.4 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/mattn/go-isatty v0.0.19 // indirect
+ github.com/mattn/go-runewidth v0.0.14 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.8 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+ github.com/ugorji/go/codec v1.2.11 // indirect
+ golang.org/x/arch v0.3.0 // indirect
+ golang.org/x/crypto v0.9.0 // indirect
+ golang.org/x/image v0.5.0 // indirect
+ golang.org/x/net v0.10.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
+ google.golang.org/protobuf v1.30.0 // indirect
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+*/
package uzsdk