Documentation
¶
Index ¶
- Constants
- func NewApplication(ctx fiberhouse.IApplicationContext) fiberhouse.ApplicationRegister
- type Application
- func (app *Application) ConfigCustomValidateInitializers() []validate.ValidateInitializer
- func (app *Application) ConfigGlobalInitializers() globalmanager.InitializerMap
- func (app *Application) ConfigRequiredGlobalKeys() []globalmanager.KeyName
- func (app *Application) ConfigValidatorCustomTags() []validate.RegisterValidatorTagFunc
- func (app *Application) GetCacheKey() string
- func (app *Application) GetContext() fiberhouse.IApplicationContext
- func (app *Application) GetDBKey() string
- func (app *Application) GetDBMongoKey() string
- func (app *Application) GetDBMysqlKey() string
- func (app *Application) GetDefaultTrafficCodecKey() string
- func (app *Application) GetFastTrafficCodecKey() string
- func (app *Application) GetKey(keyFlag fiberhouse.InstanceKeyFlag) (fiberhouse.InstanceKey, error)
- func (app *Application) GetLevel2CacheKey() string
- func (app *Application) GetLocalCacheKey() string
- func (app *Application) GetMustKey(keyFlag fiberhouse.InstanceKeyFlag) fiberhouse.InstanceKey
- func (app *Application) GetName() string
- func (app *Application) GetRedisKey() string
- func (app *Application) GetRemoteCacheKey() string
- func (app *Application) GetTaskDispatcherKey() string
- func (app *Application) GetTaskServerKey() string
- func (app *Application) GetXxxCustomKey() globalmanager.KeyName
- func (app *Application) RegisterAppMiddleware(cs fiberhouse.CoreStarter)
- func (app *Application) RegisterCoreHook(cs fiberhouse.CoreStarter)
- func (app *Application) SetName(name string)
- type IApplicationCustomizer
Constants ¶
View Source
const ( KEY_PREFIX = "__key_" KEY_MONGODB = KEY_PREFIX + "mongodb" KEY_MONGODB_LOG = KEY_PREFIX + "mongodblog" KEY_MYSQL = KEY_PREFIX + "mysql" KEY_MYSQL_TEST = KEY_PREFIX + "mysqltest" KEY_REDIS = KEY_PREFIX + "redis" KEY_REDIS_MQ = KEY_PREFIX + "redismq" KEY_EXCEPTIONS = KEY_PREFIX + "exceptions" KEY_VALIDATE_TAGS = KEY_PREFIX + "validatetags" KEY_ID_WRAP = KEY_PREFIX + "IDWarp" KEY_JSON_SONIC_ESCAPE = KEY_PREFIX + "jsonsonicescape" KEY_JSON_SONIC_FAST = KEY_PREFIX + "jsonsonicfast" KEY_TASK_SERVER = KEY_PREFIX + "taskworkerserver" KEY_TASK_CLIENT = KEY_PREFIX + "taskclientdispatcher" KEY_LOCAL_CACHE = KEY_PREFIX + "localcache" KEY_REMOTE_CACHE = KEY_PREFIX + "remotecache" KEY_LEVEL2_CACHE = KEY_PREFIX + "level2cache" )
Variables ¶
This section is empty.
Functions ¶
func NewApplication ¶
func NewApplication(ctx fiberhouse.IApplicationContext) fiberhouse.ApplicationRegister
NewApplication New项目应用
Types ¶
type Application ¶
type Application struct {
Ctx fiberhouse.IApplicationContext
KeyMongoLog string
KeyRedisTest string
// contains filtered or unexported fields
}
Application 实现Global全局接口
func (*Application) ConfigCustomValidateInitializers ¶
func (app *Application) ConfigCustomValidateInitializers() []validate.ValidateInitializer
ConfigCustomValidateInitializers 配置并返回自定义更多的语言验证器初始化器
func (*Application) ConfigGlobalInitializers ¶
func (app *Application) ConfigGlobalInitializers() globalmanager.InitializerMap
ConfigGlobalInitializers 配置全局对象初始化器 // TODO 全局对象初始化提供者
func (*Application) ConfigRequiredGlobalKeys ¶
func (app *Application) ConfigRequiredGlobalKeys() []globalmanager.KeyName
ConfigRequiredGlobalKeys 配置并返回全局管理容器中在启动时必须初始化的key 可交给全局对象初始化提供者
func (*Application) ConfigValidatorCustomTags ¶
func (app *Application) ConfigValidatorCustomTags() []validate.RegisterValidatorTagFunc
ConfigValidatorCustomTags 配置并返回验证器自定义tag函数
func (*Application) GetCacheKey ¶
func (app *Application) GetCacheKey() string
func (*Application) GetContext ¶
func (app *Application) GetContext() fiberhouse.IApplicationContext
GetContext 获取应用上下文
func (*Application) GetDBKey ¶
func (app *Application) GetDBKey() string
func (*Application) GetDBMongoKey ¶
func (app *Application) GetDBMongoKey() string
func (*Application) GetDBMysqlKey ¶
func (app *Application) GetDBMysqlKey() string
func (*Application) GetDefaultTrafficCodecKey ¶ added in v1.0.0
func (app *Application) GetDefaultTrafficCodecKey() string
func (*Application) GetFastTrafficCodecKey ¶ added in v1.0.0
func (app *Application) GetFastTrafficCodecKey() string
func (*Application) GetKey ¶ added in v1.0.0
func (app *Application) GetKey(keyFlag fiberhouse.InstanceKeyFlag) (fiberhouse.InstanceKey, error)
GetKey 获取除框架预定义实例key外的由用户自定义标识映射的实例key
func (*Application) GetLevel2CacheKey ¶
func (app *Application) GetLevel2CacheKey() string
func (*Application) GetLocalCacheKey ¶
func (app *Application) GetLocalCacheKey() string
func (*Application) GetMustKey ¶ added in v1.0.0
func (app *Application) GetMustKey(keyFlag fiberhouse.InstanceKeyFlag) fiberhouse.InstanceKey
GetMustKey 获取除框架预定义实例key外的由用户自定义标识映射的实例key,未找到则panic
func (*Application) GetRedisKey ¶
func (app *Application) GetRedisKey() string
func (*Application) GetRemoteCacheKey ¶
func (app *Application) GetRemoteCacheKey() string
func (*Application) GetTaskDispatcherKey ¶
func (app *Application) GetTaskDispatcherKey() string
func (*Application) GetTaskServerKey ¶
func (app *Application) GetTaskServerKey() string
func (*Application) GetXxxCustomKey ¶ added in v1.0.0
func (app *Application) GetXxxCustomKey() globalmanager.KeyName
GetXxxCustomKey 获取自定义实例key,实现了IApplicationCustomizer接口
func (*Application) RegisterAppMiddleware ¶
func (app *Application) RegisterAppMiddleware(cs fiberhouse.CoreStarter)
RegisterAppMiddleware 注册应用中间件
func (*Application) RegisterCoreHook ¶
func (app *Application) RegisterCoreHook(cs fiberhouse.CoreStarter)
RegisterCoreHook 注册核心应用的生命周期钩子函数
type IApplicationCustomizer ¶
type IApplicationCustomizer interface {
// 示例:自定义xxx全局对象key的获取方法
GetXxxCustomKey() globalmanager.KeyName
}
IApplicationCustomizer 定制项目应用获取实例key的方法; module业务层Api、Service、Repository、Model等层通过ctx获取application,转成IApplicationCustomizer即可调用这里定制的获取实例key方法
Click to show internal directories.
Click to hide internal directories.