Documentation
¶
Overview ¶
package for access control
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidIP = errors.New("IP address is not valid")
)
Functions ¶
func GetClientIP ¶
GetClientIP return remote IP address from request
func IsPublicIPAddress ¶
IsPublicIP reports whether ip is public network address.
Invalid ip return false.
Types ¶
type IPList ¶
type IPList struct {
// contains filtered or unexported fields
}
func NewIPWhitelist ¶
func NewIPWhitelist(vals ...interface{}) *IPList
NewIPWhitelist("192.168.1.1", "192.168.1.0/24,192.168.1.3", []string{"10.0.0.1"}, []interface{}{"127.0.0.1"})
Click to show internal directories.
Click to hide internal directories.