config

package
v0.0.0-...-e20480a Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 4 Imported by: 4

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 ClickWordConfig struct {
	FontSize int `yaml:"fontSize"`
	FontNum  int `yaml:"fontNum"`
}

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配置

func NewConfig

func NewConfig() *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配置选项

type WatermarkConfig

type WatermarkConfig struct {
	FontSize int        `yaml:"fontSize"`
	Color    color.RGBA `yaml:"color"`
	Text     string     `yaml:"text"`
}

WatermarkConfig 水印设置

Jump to

Keyboard shortcuts

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