Documentation
¶
Index ¶
- func Container() *dig.Container
- func Initialize()
- func Invoke(function interface{}, opts ...dig.InvokeOption) error
- func MustGet[T any]() T
- func MustInvoke(function interface{}, opts ...dig.InvokeOption)
- func MustProvide(constructor interface{}, opts ...dig.ProvideOption)
- func MustProvides(constructors ...interface{})
- func Provide(constructor interface{}, opts ...dig.ProvideOption) error
- func ProvideConfig()
- func ProvideDatabase()
- func ProvideHTTP()
- func ProvideLogger()
- func ProvideRedis()
- func ProvideSession()
- func ProvideTracer()
- type Apollo
- type Config
- type ConfigConf
- type Database
- type DatabaseConf
- type HTTP
- type Logger
- type LoggerConf
- type Redis
- type RedisConf
- type Routes
- type Rule
- type Session
- type SessionConf
- type Tracer
- type TracerConf
- type Validators
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶ added in v0.8.18
func Initialize()
func Invoke ¶
func Invoke(function interface{}, opts ...dig.InvokeOption) error
func MustInvoke ¶ added in v0.8.16
func MustInvoke(function interface{}, opts ...dig.InvokeOption)
func MustProvide ¶ added in v0.8.16
func MustProvide(constructor interface{}, opts ...dig.ProvideOption)
func MustProvides ¶ added in v0.8.16
func MustProvides(constructors ...interface{})
func Provide ¶ added in v0.8.16
func Provide(constructor interface{}, opts ...dig.ProvideOption) error
func ProvideConfig ¶
func ProvideConfig()
func ProvideDatabase ¶
func ProvideDatabase()
func ProvideHTTP ¶ added in v0.9.6
func ProvideHTTP()
func ProvideLogger ¶
func ProvideLogger()
func ProvideRedis ¶
func ProvideRedis()
func ProvideSession ¶ added in v0.8.21
func ProvideSession()
func ProvideTracer ¶
func ProvideTracer()
Types ¶
type ConfigConf ¶ added in v0.8.17
type ConfigConf struct {
ConfigPath string `mapstructure:"config_path"`
ConfigType string `mapstructure:"config_type"`
ApolloConf string `mapstructure:"apollo_conf"`
ApUpdateCallback pkg.ApUpdateCallback `mapstructure:"ap_update_callback"`
InitCallback func() `mapstructure:"init_callback"`
}
ConfigConf 基础本地初始化配置
type Database ¶
type Database = *pkg.DatabasePkg
type DatabaseConf ¶ added in v0.8.17
type DatabaseConf struct {
DBKey string `mapstructure:"db_key"`
CallBack func(*gorm.DB) `mapstructure:"call_back"`
}
DatabaseConf 数据库初始化配置
type LoggerConf ¶ added in v0.8.17
type LoggerConf struct {
LogDir string `mapstructure:"log_dir"` // 日志目录
PreLogFunc pkg.PreLogFunc `mapstructure:"pre_log_func"` // 日志记录前的前置处理方法
Log2Tracer bool `mapstructure:"log_2_tracer"` // 是否同时把日志记录到链路跟踪
}
LoggerConf 日志初始化配置
type RedisConf ¶ added in v0.8.17
type RedisConf struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Password string `mapstructure:"password"`
PoolSize int `mapstructure:"pool_size"`
DefaultDB int `mapstructure:"default_db"`
Prefix string `mapstructure:"prefix"`
}
RedisConf redis缓存初始化配置
type SessionConf ¶ added in v0.8.21
type SessionConf struct {
Prefix string `mapstructure:"prefix"`
CookieName string `mapstructure:"cookie_name"`
CookieDomain string `mapstructure:"cookie_domain"`
Secure bool `mapstructure:"secure"`
HTTPOnly bool `mapstructure:"http_only"`
}
SessionConf LoggerConf 日志初始化配置
type TracerConf ¶ added in v0.8.17
type TracerConf struct {
Enable bool `mapstructure:"enable"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
MainServiceName string `mapstructure:"main_service_name"`
}
TracerConf 链路跟踪初始化配置
type Validators ¶ added in v0.8.20
type Validators = pkg.Validators
Click to show internal directories.
Click to hide internal directories.