Documentation
¶
Index ¶
- Constants
- func BootStrap(env string, property ...Property) iris.Configurator
- func Get(app context.Application, key string) interface{}
- func GetBool(app context.Application, key string) bool
- func GetInt(app context.Application, key string) int64
- func GetString(app context.Application, key string) string
- func ReadYAML(filename string) ([]byte, error)
- type App
- type Cache
- type Configuration
- type Database
- type Env
- type Log
- type Property
- type SQL
- type Static
Constants ¶
View Source
const ( AppName = "AppName" AppEnv = "AppEnv" AppUrl = "AppUrl" AppPort = "AppPort" )
View Source
const ( DatabaseSQL = "DatabaseSQL" DatabaseCache = "DatabaseCache" )
View Source
const ( LogLevel = "LogLevel" LogEnabled = "LogEnabled" LogFile = "LogFile" LogStatus = "LogStatus" LogIP = "LogIP" LogMethod = "LogMethod" LogPath = "LogPath" LogQuery = "LogQuery" LogColumns = "LogColumns" LogMessageContextKeys = "LogMessageContextKeys" LogMessageHeaderKeys = "LogMessageHeaderKeys" )
View Source
const ( StaticRequestPath = "StaticRequestPath" StaticAssets = "StaticAssets" StaticFavicon = "StaticFavicon" StaticIndexName = "StaticIndexName" StaticGzip = "StaticGzip" StaticShowList = "StaticShowList" )
View Source
const (
Production = "production"
)
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(app context.Application, key string) interface{}
Types ¶
type App ¶
type App struct {
AppName string `yaml:"AppName"`
AppEnv string `yaml:"AppEnv"`
AppUrl string `yaml:"AppUrl"`
AppPort string `yaml:"AppPort"`
}
func DefaultApp ¶
func DefaultApp() App
func GetApp ¶
func GetApp(app context.Application) App
type Configuration ¶
type Configuration interface {
Register(others *map[string]interface{})
}
type Database ¶
func DefaultDatabase ¶
func DefaultDatabase() Database
func GetDatabase ¶
func GetDatabase(app context.Application) Database
type Env ¶
type Env struct {
Iris iris.Configuration `yaml:"Iris"`
App App `yaml:"App"`
Static Static `yaml:"Static"`
Log Log `yaml:"Log"`
Database Database `yaml:"Database"`
}
func DefaultEnv ¶
func DefaultEnv() Env
type Log ¶
type Log struct {
Level string `yaml:"Level"`
Enabled bool `yaml:"Enabled"`
File string `yaml:"File"`
Status bool `yaml:"Status"`
IP bool `yaml:"IP"`
Method bool `yaml:"Method"`
Path bool `yaml:"Path"`
Query bool `yaml:"Query"`
Columns bool `yaml:"Columns"`
MessageContextKeys []string `yaml:"MessageContextKeys"`
MessageHeaderKeys []string `yaml:"MessageHeaderKeys"`
}
func DefaultLog ¶
func DefaultLog() Log
func GetLog ¶
func GetLog(app context.Application) Log
type SQL ¶
type SQL struct {
Name string `yaml:"Name"`
Driver string `yaml:"Driver"`
Host string `yaml:"Host"`
Port int `yaml:"Port"`
Dbname string `yaml:"Dbname"`
Username string `yaml:"Username"`
Password string `yaml:"Password"`
Sslmode bool `yaml:"Sslmode"`
Charset string `yaml:"Charset"`
MaxIdle int `yaml:"MaxIdle"`
MaxOpen int `yaml:"MaxOpen"`
Log bool `yaml:"Log"`
}
type Static ¶
type Static struct {
RequestPath string `yaml:"RequestPath"`
Assets string `yaml:"Assets"`
Favicon string `yaml:"Favicon"`
IndexName string `yaml:"IndexName"`
Gzip bool `yaml:"Gzip"`
ShowList bool `yaml:"ShowList"`
}
func DefaultStatic ¶
func DefaultStatic() Static
func GetStatic ¶
func GetStatic(app context.Application) Static
Click to show internal directories.
Click to hide internal directories.