Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Captcha ¶
type Captcha struct {
*base64Captcha.Captcha
}
Captcha Package github.com/mojocn/base64Captcha
func (*Captcha) WithLogger ¶
WithLogger Set up the logger required by this package
type DefaultLogger ¶
type DefaultLogger struct { }
DefaultLogger The default logger implementation
func (DefaultLogger) Error ¶
func (d DefaultLogger) Error(args ...interface{})
type DriverConfig ¶
type DriverConfig struct { CaptchaType string `mapstructure:"captcha_type"` Length int `mapstructure:"length"` Height int `mapstructure:"height"` Width int `mapstructure:"width"` NoiseCount int `mapstructure:"noise_count"` //string ShowLineOptions int `mapstructure:"show_line_options"` // 2 or 4 or 8 Source string `mapstructure:"source"` BackgroundColor *color.RGBA `mapstructure:"background"` Fonts []string `mapstructure:"fonts"` // audio Language string `mapstructure:"language"` // digit MaxSkew float64 `mapstructure:"max_skew"` DotCount int `mapstructure:"dot_count"` }
DriverConfig Configuration parameters of the captcha
func (DriverConfig) NewDriver ¶
func (config DriverConfig) NewDriver() base64Captcha.Driver
NewDriver generate a base64Captcha.Driver instance according to the configuration
type ILogger ¶
type ILogger interface {
Error(args ...interface{})
}
ILogger Log interface required by this package
type Loader ¶
type Loader struct { Driver DriverConfig `mapstructure:"driver"` Store StoreConfig `mapstructure:"store"` // contains filtered or unexported fields }
Loader Loader, this will be the first structure that should be derived from this package
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore Use redis to store the verification code content
type StoreConfig ¶
type StoreConfig struct { RedisType string `mapstructure:"redis_type"` Network string `mapstructure:"network"` Addr string `mapstructure:"addr"` Password string `mapstructure:"password"` DB int `mapstructure:"db"` Addresses []string `mapstructure:"addresses"` Username string `mapstructure:"username"` SentinelPassword string `mapstructure:"sentinel_password"` MaxRetries int `mapstructure:"max_retries"` MinRetryBackoff string `mapstructure:"min_retry_backoff"` MaxRetryBackoff string `mapstructure:"max_retry_backoff"` DialTimeout string `mapstructure:"dial_timeout"` ReadTimeout string `mapstructure:"read_timeout"` WriteTimeout string `mapstructure:"write_timeout"` PoolSize int `mapstructure:"pool_size"` MinIdleConns int `mapstructure:"min_idle_conns"` MaxConnAge string `mapstructure:"max_conn_age"` PoolTimeout string `mapstructure:"pool_timeout"` IdleTimeout string `mapstructure:"idle_timeout"` IdleCheckFrequency string `mapstructure:"idle_check_frequency"` MaxRedirects int `mapstructure:"max_redirects"` ReadOnly bool `mapstructure:"read_only"` RouteByLatency bool `mapstructure:"route_by_latency"` RouteRandomly bool `mapstructure:"route_randomly"` SlaveOnly bool `mapstructure:"slave_only"` Randomly bool `mapstructure:"randomly"` MasterName string `mapstructure:"master_name"` NewClient func(opt *redis.Options) *redis.Client TLSConfig *tls.Config Dialer func(ctx context.Context, network, addr string) (net.Conn, error) OnConnect func(ctx context.Context, cn *redis.Conn) error Limiter redis.Limiter ClusterSlots func(ctx context.Context) ([]redis.ClusterSlot, error) }
StoreConfig redis config
func (StoreConfig) NewStore ¶
func (config StoreConfig) NewStore() *RedisStore
NewStore get the specified redis store according to the configuration information
Click to show internal directories.
Click to hide internal directories.