Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockPuzzleConfig ¶
type BlockPuzzleConfig struct { // 校验时 容错偏移量 Offset int `yaml:"offset"` }
type ClickWordConfig ¶
type Config ¶
type Config struct { Watermark *WatermarkConfig `yaml:"watermark"` ClickWord *ClickWordConfig `yaml:"clickWord"` BlockPuzzle *BlockPuzzleConfig `yaml:"blockPuzzle"` // 验证码使用的缓存类型 CacheType string `yaml:"cacheType"` CacheExpireSec int `yaml:"cacheExpireSec"` // 项目的绝对路径: 图片、字体等 ResourcePath string `yaml:"resourcePath"` }
func BuildConfig ¶
func BuildConfig(cacheType, resourcePath string, waterConfig *WatermarkConfig, clickWordConfig *ClickWordConfig, puzzleConfig *BlockPuzzleConfig, cacheExpireSec int) *Config
BuildConfig 生成config配置
type RedisConfig ¶
type RedisConfig struct { //redis单机或者集群访问地址 DBAddress []string `yaml:"dbAddress"` //最大空闲连接数 DBMaxIdle int `yaml:"dbMaxIdle"` //最大连接数 DBMaxActive int `yaml:"dbMaxActive"` //redis表示空闲连接保活时间 DBIdleTimeout int `yaml:"dbIdleTimeout"` //redis用户 DBUserName string `yaml:"dbUserName"` //redis密码 DBPassWord string `yaml:"dbPassWord"` //是否使用redis集群 EnableCluster bool `yaml:"enableCluster"` //单机模式下使用redis的指定库,比如:0,1,2,3等等,默认为0 DB int `yaml:"db"` }
RedisConfig redis配置选项
Click to show internal directories.
Click to hide internal directories.