irisapp

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 8 Imported by: 0

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 中间件 5. 设置数据库 6. 设置缓存: 默认使用 memcache @params settingsName 配置文件名称

Types

type IrisAppConfig

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
	AuthFunc auth.AuthFunc
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL