Documentation ¶
Index ¶
- func ClientIP(req *http.Request) string
- func ClientPublicIP(req *http.Request) string
- func ContentType(req *http.Request) string
- func HasLocalIP(ip net.IP) bool
- func HasLocalIPAddr(ip string) bool
- func IsWebsocket(req *http.Request) bool
- func LongToIP(i uint) (net.IP, error)
- func LongToIPString(i uint) (string, error)
- func RemoteIP(req *http.Request) string
- func StringToLong(ip string) (uint, error)
- func ToLong(ip net.IP) (uint, error)
- type Filter
- func (f *Filter) AllowIP(ip string) bool
- func (f *Filter) Allowed(ipstr string) bool
- func (f *Filter) BlockIP(ip 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(allowed bool)
- func (f *Filter) ToggleIP(str string, allowed bool) bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientPublicIP ¶
func ContentType ¶
ContentType returns the Content-Type header of the request.
func HasLocalIP ¶
func HasLocalIPAddr ¶
func IsWebsocket ¶
func LongToIPString ¶
func StringToLong ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) NetAllowed ¶
NetAllowed returns if a given net.IP can pass through the filter
func (*Filter) NetBlocked ¶
NetBlocked returns if a given net.IP can NOT pass through the filter
func (*Filter) ToggleDefault ¶
ToggleDefault alters the default setting
Click to show internal directories.
Click to hide internal directories.