Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidItem = errors.New("[iprangetree] invalid IP range item") ErrItemReplaced = errors.New("[iprangetree] item was replaced") ErrInvalidRangeFormat = errors.New("[iprangetree] invalid range format") ErrInvalidRangeValues = errors.New("[iprangetree] start IP is less then end IP") )
Errors list
Functions ¶
This section is empty.
Types ¶
type IPItemAccessor ¶
IPItemAccessor data accessor interface
type IPItemFix ¶
type IPItemFix struct { StartIP ipFix EndIP ipFix Data interface{} }
IPItemFix IP range
type IPItemV4 ¶
type IPItemV4 struct { StartIP ipV4 EndIP ipV4 Data interface{} }
IPItemV4 IP range
type IPTree ¶
type IPTree struct {
// contains filtered or unexported fields
}
IPTree base
func (*IPTree) AddRangeByString ¶
AddRangeByString data by IP range string or single IP Example:
db.AddRangeByString("127.0.0.1", data) db.AddRangeByString("127.0.0.1-127.0.0.2", data)
func (*IPTree) Lookup ¶
func (t *IPTree) Lookup(ip net.IP) (response IPItemAccessor)
Lookup to search the IP value in the IP tree
func (*IPTree) LookupByString ¶
func (t *IPTree) LookupByString(ip string) IPItemAccessor
LookupByString parse the IP value and search data in the IP tree
Source Files ¶
Click to show internal directories.
Click to hide internal directories.