Documentation
¶
Index ¶
- func CheckAuto(args string) bool
- func CheckIsBan(args string) bool
- func CheckIsWhite(args string) bool
- func ClearAll() (err error)
- func ClearIP(args *ArgsClearIP) (err error)
- func GetAddressByIP(args *ArgsGetAddressByIP) (data string, err error)
- func Init() (err error)
- func SetBan(args *ArgsSetBan) (err error)
- func SetIP(args *ArgsSetIP) (err error)
- func SetOpenBan(args bool)
- func SetOpenWhite(args bool)
- func SetWhite(args *ArgsSetWhite) (err error)
- type ArgsClearIP
- type ArgsGetAddressByIP
- type ArgsGetList
- type ArgsSetBan
- type ArgsSetIP
- type ArgsSetWhite
- type FieldsIPAddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddressByIP ¶
func GetAddressByIP(args *ArgsGetAddressByIP) (data string, err error)
GetAddressByIP 获取IP地理位置 TODO: 未完成,寻找合适的外部模块实现即可
Types ¶
type ArgsGetAddressByIP ¶
type ArgsGetAddressByIP struct {
//IP地址
IP string
}
ArgsGetAddressByIP 获取IP地理位置参数
type ArgsGetList ¶
type ArgsGetList struct {
//分页
Pages CoreSQLPages.ArgsDataList
//搜索
Search string
}
ArgsGetList 获取列表参数
type ArgsSetBan ¶
type ArgsSetBan struct {
//IP地址或正则表达式
IP string
//是否为正则表达式
IsMatch bool
//是否列入名单
B bool
//过期时间
ExpireTime string
}
ArgsSetBan 设置IP在黑名单参数
type ArgsSetIP ¶
type ArgsSetIP struct {
//IP地址或正则表达式
IP string
//是否为正则表达式
IsMatch bool
//是否列入黑名单
IsBan bool
//是否列入白名单
IsWhite bool
//过期时间
// ISO时间格式
ExpireTime string
}
ArgsSetIP 设置数据参数
type ArgsSetWhite ¶
type ArgsSetWhite struct {
//IP地址或正则表达式
IP string
//是否为正则表达式
IsMatch bool
//是否列入名单
B bool
//过期时间
ExpireTime string
}
ArgsSetWhite 设置IP在白名单情况参数
type FieldsIPAddr ¶
type FieldsIPAddr struct {
//ID
ID int64 `db:"id" json:"id"`
//创建时间
CreateAt time.Time `db:"create_at" json:"createAt"`
//更新时间
UpdateAt time.Time `db:"update_at" json:"updateAt"`
//过期时间
ExpireAt time.Time `db:"expire_at" json:"expireAt"`
//要匹配的IP地址
IP string `db:"ip" json:"ip"`
//是否为正则表达式
// 正则表达式将匹配IP字段指定的范围区间
// 注意发生错误将自动跳过
IsMatch bool `db:"is_match" json:"isMatch"`
//是否列入黑名单
IsBan bool `db:"is_ban" json:"isBan"`
//是否白名单
IsWhite bool `db:"is_white" json:"isWhite"`
}
FieldsIPAddr 基本结构体
func GetList ¶
func GetList(args *ArgsGetList) (dataList []FieldsIPAddr, dataCount int64, err error)
GetList 获取列表
Click to show internal directories.
Click to hide internal directories.