go-iptree

module
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2025 License: Apache-2.0

README

GoLang IPTree

Forked from https://github.com/zmap/go-iptree

Build Status

This is a golang based prefix tree for IP subnets

Install

go-iptree can be used by including:

import "github.com/iqhive/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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳