config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunOSS

type AliyunOSS struct {
	Endpoint        string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
	AccessKeyId     string `mapstructure:"access-key-id" json:"accessKeyId" yaml:"access-key-id"`
	AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"`
	BucketName      string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"`
	BucketUrl       string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"`
	BasePath        string `mapstructure:"base-path" json:"basePath" yaml:"base-path"`
}

type DBConfig

type DBConfig struct {
	Path         string `mapstructure:"path" json:"path" yaml:"path"`                             // 服务器地址
	Port         string `mapstructure:"port" json:"port" yaml:"port"`                             // 端口
	Config       string `mapstructure:"config" json:"config" yaml:"config"`                       // 高级配置
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`                     // 数据库名
	Username     string `mapstructure:"username" json:"username" yaml:"username"`                 // 数据库用户名
	Password     string `mapstructure:"password" json:"password" yaml:"password"`                 // 数据库密码
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"` // 空闲中的最大连接数
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"` // 打开到数据库的最大连接数
	MaxLifeTime  int    `mapstructure:"max-life-time" json:"maxLifeTime" yaml:"max-life-time"`
	LogMode      string `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"` // 是否开启Gorm全局日志
	LogZap       bool   `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"`    // 是否通过zap写入日志文件
	DbType       string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
}

func (*DBConfig) ContactDsn

func (db *DBConfig) ContactDsn(dbName string) string

func (*DBConfig) Dsn

func (db *DBConfig) Dsn() string

type EmaiConfig

type EmaiConfig struct {
	To       string `mapstructure:"to" json:"to" yaml:"to"`                   // 收件人:多个以英文逗号分隔
	Port     int    `mapstructure:"port" json:"port" yaml:"port"`             // 端口
	From     string `mapstructure:"from" json:"from" yaml:"from"`             // 收件人
	Host     string `mapstructure:"host" json:"host" yaml:"host"`             // 服务器地址
	IsSSL    bool   `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"`        // 是否SSL
	Secret   string `mapstructure:"secret" json:"secret" yaml:"secret"`       // 密钥
	Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称
}

type EtcdConfig

type EtcdConfig struct {
}

type ExcelConfig

type ExcelConfig struct {
	Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}

type Local

type Local struct {
	Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件路径
}

type MongoConfig

type MongoConfig struct {
	Address           []string `mapstructure:"address" 	json:"address" yaml:"address"`
	Direct            bool     `mapstructure:"direct" 	json:"direct" yaml:"direct"`
	Timeout           int      `mapstructure:"timeout" 	json:"timeout" yaml:"timeout"`
	Database          string   `mapstructure:"database" json:"database" yaml:"database"`
	Source            string   `mapstructure:"source" json:"source" yaml:"source"`
	Username          string   `mapstructure:"username" json:"username" yaml:"username"`
	Password          string   `mapstructure:"password" json:"password" yaml:"password"`
	MaxPoolSize       int      `mapstructure:"max-pool-size" json:"maxPoolSize" yaml:"max-pool-size"`
	RetainChatRecords int      `mapstructure:"retain-chat-records" json:"retainChatRecords" yaml:"retain-chat-records"`
}

type OssConfig

type OssConfig struct {
	OssType string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"` // Oss类型
}

type Qiniu

type Qiniu struct {
	Zone          string `mapstructure:"zone" json:"zone" yaml:"zone"`                                // 存储区域
	Bucket        string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`                          // 空间名称
	ImgPath       string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`                     // CDN加速域名
	UseHTTPS      bool   `mapstructure:"use-https" json:"useHttps" yaml:"use-https"`                  // 是否使用https
	AccessKey     string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`               // 秘钥AK
	SecretKey     string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`               // 秘钥SK
	UseCdnDomains bool   `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
}

type RedisConfig

type RedisConfig struct {
	DB          int    `mapstructure:"db" json:"db" yaml:"db"`                   // redis的哪个数据库
	Addr        string `mapstructure:"addr" json:"addr" yaml:"addr"`             // 服务器地址:端口
	Password    string `mapstructure:"password" json:"password" yaml:"password"` // 密码
	MaxIdle     int    `mapstructure:"max-idle" json:"maxIdle" yaml:"max-idle"`
	MaxActive   int    `mapstructure:"max-active" json:"maxActive" yaml:"max-active"`
	IdleTimeout int    `mapstructure:"idle-timeout" json:"idleTimeout" yaml:"idle-timeout"`
}

type ServerConfig

type ServerConfig struct {
	Env          string `mapstructure:"env" json:"env" yaml:"env"` // 环境值
	Name         string `mapstructure:"name" json:"name" yaml:"name"`
	Address      string `mapstructure:"address" json:"address" yaml:"address"`
	Port         string `mapstructure:"port" json:"port" yaml:"port"`
	ReadTimeout  int    `mapstructure:"read-time-out" json:"readTimeout" yaml:"read-time-out"`
	WriteTimeout int    `mapstructure:"write-time-out" json:"writeTimeout" yaml:"write-time-out"`
}

type TencentCOS

type TencentCOS struct {
	Bucket     string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
	Region     string `mapstructure:"region" json:"region" yaml:"region"`
	SecretID   string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
	SecretKey  string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
	BaseURL    string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
	PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
}

type ZapConfig

type ZapConfig struct {
	Level         string `mapstructure:"level" json:"level" yaml:"level"`                           // 级别
	Format        string `mapstructure:"format" json:"format" yaml:"format"`                        // 输出
	Prefix        string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`                        // 日志前缀
	Director      string `mapstructure:"director" json:"director"  yaml:"director"`                 // 日志文件夹
	ShowLine      bool   `mapstructure:"show-line" json:"showLine" yaml:"showLine"`                 // 显示行
	EncodeLevel   string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"`       // 编码级
	StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` // 栈名
	LogInConsole  bool   `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"`  // 输出控制台
}

Jump to

Keyboard shortcuts

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