config

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAccountLimit = []conf.Limit{
	{Timeout: 5 * 60, TriggerTime: 3, ForbiddenTime: 5 * 60},
	{Timeout: 60 * 60, TriggerTime: 10, ForbiddenTime: 60 * 60 * 24},
	{Timeout: 60 * 60 * 24 * 5, TriggerTime: 20, ForbiddenTime: 60 * 60 * 24 * 30},
}
View Source
var DefaultIpLimit = []conf.Limit{
	{Timeout: 5 * 60, TriggerTime: 30, ForbiddenTime: 5 * 60},
	{Timeout: 60 * 60, TriggerTime: 100, ForbiddenTime: 60 * 60 * 24},
	{Timeout: 60 * 60 * 24 * 5, TriggerTime: 200, ForbiddenTime: 60 * 60 * 24 * 30},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	zrpc.RpcServerConf
	Database   conf.Database
	CacheRedis cache.ClusterConf
	UserToken  struct {
		AccessSecret string
		AccessExpire int64
	}
	OssConf  conf.OssConf `json:",optional"`
	Event    conf.EventConf
	Register struct {
		NeedDetail   bool   `json:",default=true"` //注册的时候是否需要填写用户信息,账号密码
		SecondSecret string //第二步需要的token秘钥
		SecondExpire int64  //token过期时间 单位:秒
	} `json:",optional"`
	TimedJobRpc conf.RpcClientConf `json:",optional"`
	UserOpt     struct {
		NeedUserName bool  `json:",default=true"` //注册是否必须填写账号密码
		NeedPassWord bool  `json:",default=true"` //注册是否必须填写账号密码
		PassLevel    int32 `json:",default=2"`    //用户密码强度级别
	} // 用户登录注册选项
	Map struct {
		Mode         string `json:",default=gaode"`
		AccessKey    string
		AccessSecret string
	}
	Sms conf.Sms

	CaptchaPhoneIpLimit      []conf.Limit `json:",optional"`
	CaptchaPhoneAccountLimit []conf.Limit `json:",optional"`
	CaptchaEmailIpLimit      []conf.Limit `json:",optional"`
	CaptchaEmailAccountLimit []conf.Limit `json:",optional"`
	LoginPwdIpLimit          []conf.Limit `json:",optional"` //密码错误限制
	LoginPwdAccountLimit     []conf.Limit `json:",optional"` //密码错误限制
}

Jump to

Keyboard shortcuts

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