Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplicationConfig = new(Application)
View Source
var CacheConfig = new(Cache)
View Source
var ( // DatabaseConfig = new(db.ConnectionOptions) DatabasesConfig = make(map[string]*db.ConnectionOptions) )
View Source
var ExtConfig = new(Extend)
View Source
var (
ExtendConfig interface{}
)
View Source
var FilesystemConfig = new(Filesystem)
View Source
var LoggerConfig = new(Logger)
View Source
var (
RedisConfig = new(Redis)
)
View Source
var ServerConfig = new(map[string]Server)
Functions ¶
Types ¶
type Application ¶
type Config ¶
type Config struct { Application *Application `mapstructure:"application" json:"application" yaml:"application"` Logger *Logger `mapstructure:"logger" json:"logger" yaml:"logger"` Cache *Cache `mapstructure:"cache" yaml:"cache" json:"cache"` Databases map[string]*db.ConnectionOptions `json:"databases" yaml:"databases"` Filesystem *Filesystem `mapstructure:"filesystem" json:"mysql" yaml:"filesystem"` Redis *Redis `mapstructure:"redis" json:"redis" yaml:"redis"` Server map[string]Server `mapstructure:"server" json:"server" yaml:"server"` Extend interface{} `yaml:"extend"` }
type Extend ¶
type Extend struct {
Demo Demo // 这里配置对应配置文件的结构即可
}
Extend 扩展配置
extend: demo: name: demo-name
Example: config.ExtConfig......!!
type Filesystem ¶
type Logger ¶
type Logger struct { Type string `mapstructure:"type" json:"type" yaml:"type"` Level string `mapstructure:"level" json:"level" yaml:"level"` // 级别 TimeFormat string `mapstructure:"time-format" json:"time-format" yaml:"time-format"` // 时间格式 Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 日志前缀 Path string `mapstructure:"path" json:"path" yaml:"path"` // 日志文件 ShowLine bool `mapstructure:"show-line" json:"show-line" yaml:"show-line"` // 显示行 EncodeLevel string `mapstructure:"encode-level" json:"encode-level" yaml:"encode-level"` // 编码级 StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktrace-key" yaml:"stacktrace-key"` // 栈名 Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout"` // 输出控制台 Cut LoggerCut `mapstructure:"cut" json:"cut" yaml:"cut"` // 日志裁切 }
type LoggerCut ¶
type LoggerCut struct { Cap uint `mapstructure:"cap" json:"cap" yaml:"cap"` // 裁切 MB MaxAge uint `mapstructure:"max-age" json:"max-age" yaml:"max-age"` // 最大备份天数 MaxBackups uint `mapstructure:"max-age" json:"max-backups" yaml:"max-backups"` // 最大备份数 Compress bool `mapstructure:"compress" json:"compress" yaml:"compress"` // 是否压缩 }
type Minio ¶
type Minio struct { Endpoint string AccessKeyID string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id"` SecretAccessKey string `mapstructure:"secret-access-key" json:"secret-access-key" yaml:"secret-access-key"` Secure bool `mapstructure:"secure" json:"secure" yaml:"secure"` Region string `mapstructure:"region" json:"region" yaml:"region"` Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` }
type Redis ¶
func (*Redis) GetRedisOptions ¶
Click to show internal directories.
Click to hide internal directories.