Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIrisApp ¶
func NewIrisApp(c *IrisAppConfig) *iris.Application
1. 创建 iris app 2. 设置日志级别 3. 设置 recover 中间件 4. 设置 logger 中间件 @params settingsName 配置文件名称
Types ¶
type IrisAppConfig ¶ added in v0.1.4
type IrisAppConfig struct {
// setting 名字, 默认值 settings.yaml
SettingsName string
// 默认值: notFound
NotFoundHandler iris.Handler
// 默认值: internalServerError
InternalServerErrorHandler iris.Handler
// 是否启用swagger, 默认值: false, swagger 无法做到完全与main函数分离,不在这里初始化
// EnableSwagger bool
// 启用cache, 选项: cache.CacheTypeMem, cache.CacheTypeRedis, 默认值: cache.CacheTypeMem
CacheType string
// 是否初始化数据库, 默认值: false
EnableDb bool
// Auth处理中间件, 默认值: nil
Auth auth.IAuth
}
Click to show internal directories.
Click to hide internal directories.