Documentation ¶
Index ¶
- func Command(conf, appkey *string)
- func FileDir() string
- func Init()
- func Lang() string
- func Log() *logs.Conf
- func OK() bool
- func Path() string
- func Register(handle ConfingHandle, finish ...FinishHandle)
- func SameSite() http.SameSite
- func Session() *sessionConf.Conf
- func SetPath(confPath string)
- func Trans() string
- func User() interface{}
- func Wrap() bool
- type AppConf
- type AppConfMgr
- type CORSConf
- type ConfingHandle
- type DiscoveryConf
- type FinishHandle
- type PaginationConf
- type RegistryConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileDir ¶
func FileDir() string
FileDir if app config configuration fileDir return it,orherwise return app exec path
func Register ¶ added in v1.1.5
func Register(handle ConfingHandle, finish ...FinishHandle)
Register regist handler of conf
Types ¶
type AppConf ¶
type AppConf struct { Key string `json:"key"` Name string `json:"name"` Addr string `json:"addr"` CertFile string `json:"certFile"` //tls cert file KeyFile string `json:"keyFile"` //tls cert key file FileDir string `json:"fileDir"` Debug bool `json:"debug"` BaseURL string `json:"baseUrl"` IDNode uint8 `json:"idNode"` //id node Lang string `json:"lang"` //lang Trans string `json:"trans"` //trans SameSiteText string `json:"sameSite"` //strict|lax|none Wrap *bool `json:"wrap"` //wrap response body Session *sessionConf.Conf `json:"session"` //session Log *logs.Conf `json:"log"` //log conf CORS *CORSConf `json:"cors"` //CORS Conf interface{} `json:"conf"` //user conf Extend string `json:"extend"` //user extend Page *PaginationConf `json:"page"` //pagination conf Registry *RegistryConf `json:"registry"` //service registry center Discovery *DiscoveryConf `json:"discovery"` //service discovery center SameSite http.SameSite `json:"-"` // contains filtered or unexported fields }
AppConf app config item
type AppConfMgr ¶
AppConfMgr app config
type CORSConf ¶ added in v1.1.4
type CORSConf struct { AllowOrigin string `json:"allowOrigin"` AllowMethods string `json:"allowMethods"` AllowHeaders string `json:"allowHeaders"` AllowCredentials string `json:"allowCredentials"` MaxAge string `json:"maxAge"` }
CORSConf config
type DiscoveryConf ¶ added in v1.1.7
type DiscoveryConf struct { Enable bool `json:"enable"` // Prefix string `json:"prefix"` // Endpoints string `json:"endpoints"` //localhost:2379,localhost:22379 DialTimeout int64 `json:"timeout"` //second default 5s }
DiscoveryConf config
func Discovery ¶ added in v1.1.7
func Discovery() *DiscoveryConf
Discovery return service discovery conf
type FinishHandle ¶
FinishHandle finished handler conf
type PaginationConf ¶ added in v1.1.7
type PaginationConf struct { Page string `json:"page"` Total string `json:"total"` PageRow string `json:"pageRow"` }
PaginationConf config
type RegistryConf ¶ added in v1.1.7
type RegistryConf struct { Enable bool `json:"enable"` // BaseURL string `json:"baseUrl"` // Prefix string `json:"prefix"` // Endpoints string `json:"endpoints"` //localhost:2379,localhost:22379 DialTimeout int64 `json:"timeout"` //second default 5s TTL int64 `json:"ttl"` }
RegistryConf config
Click to show internal directories.
Click to hide internal directories.