https://github.com/zmap/go-iptree
GoLang IP Radix Tree
https://github.com/zmap/go-iptree
Last synced: 4 months ago
JSON representation
GoLang IP Radix Tree
- Host: GitHub
- URL: https://github.com/zmap/go-iptree
- Owner: zmap
- License: apache-2.0
- Created: 2016-08-17T18:26:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-31T04:30:55.000Z (almost 5 years ago)
- Last Synced: 2024-12-10T22:24:38.938Z (over 1 year ago)
- Language: Go
- Size: 22.5 KB
- Stars: 114
- Watchers: 17
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GoLang IPTree
=============
[](https://travis-ci.org/zmap/go-iptree)
This is a golang based prefix tree for IP subnets
Install
=======
go-iptree can be used by including:
import "github.com/zmap/go-iptree/iptree"
Usage
=====
Below is a simple example:
t := iptree.New()
t.AddByString("0.0.0.0", 0)
t.AddByString("128.255.0.0/16", 1)
t.AddByString("128.255.134.0/24", 0)
if val, found, err := t.GetByString("128.255.134.5"); err == nil && found {
fmt.Println("Value is ", val)
}