Documentation
¶
Index ¶
- type Filter
- func (f *Filter) AllowIP(str string) bool
- func (f *Filter) Allowed(ip string) bool
- func (f *Filter) BlockIP(str string) bool
- func (f *Filter) Blocked(ip string) bool
- func (f *Filter) NetAllowed(ip net.IP) bool
- func (f *Filter) NetBlocked(ip net.IP) bool
- func (f *Filter) ToggleDefault(allow bool)
- func (f *Filter) ToggleIP(str string, allowed bool) bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter IP 过滤器主结构体,用于控制 IP 访问权限
func (*Filter) NetAllowed ¶
NetAllowed 检查给定 net.IP 是否被允许访问
func (*Filter) NetBlocked ¶
NetBlocked 检查给定 net.IP 是否被阻止访问(与 NetAllowed 相反)
Click to show internal directories.
Click to hide internal directories.