ipranger

package module
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 11 Imported by: 27

README

ipranger

ipranger helps you to keep track of yours ip with the integration of ProjectDiscovery hmap key value store.

ipranger also integrate mapcidr library:

...
ips, err := ipranger.Ips("127.0.0.1/16")
if err != nil {
	panic(err)
}
fmt.Println(len(ips))
...

License

ipranger is distributed under MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ips

func Ips(cidr string) ([]string, error)

Ips of a cidr

Types

type IPRanger

type IPRanger struct {
	sync.RWMutex

	Np *networkpolicy.NetworkPolicy

	Hosts         *hybrid.HybridMap
	Stats         Stats
	CoalescedIPV4 []*net.IPNet
	CoalescedIPV6 []*net.IPNet
	// contains filtered or unexported fields
}

func New

func New() (*IPRanger, error)

func (*IPRanger) Add

func (ir *IPRanger) Add(host string) error

func (*IPRanger) AddHostWithMetadata added in v0.0.3

func (ir *IPRanger) AddHostWithMetadata(host, metadata string) error

func (*IPRanger) Close

func (ir *IPRanger) Close() error

func (*IPRanger) Contains

func (ir *IPRanger) Contains(host string) bool

func (*IPRanger) ContainsAll added in v0.0.3

func (ir *IPRanger) ContainsAll(hosts ...string) bool

func (*IPRanger) ContainsAny added in v0.0.3

func (ir *IPRanger) ContainsAny(hosts ...string) bool

func (*IPRanger) Delete

func (ir *IPRanger) Delete(host string) error

func (*IPRanger) GetHostsByIP added in v0.0.3

func (ir *IPRanger) GetHostsByIP(IP string) ([]string, error)

func (*IPRanger) HasIP

func (ir *IPRanger) HasIP(IP string) bool

func (*IPRanger) IsValid added in v0.0.3

func (ir *IPRanger) IsValid(host string) bool

func (*IPRanger) Shrink added in v0.0.3

func (ir *IPRanger) Shrink() error

type Stats added in v0.0.3

type Stats struct {
	Hosts uint64
	IPS   uint64
	Ports uint64
}

func (Stats) Total added in v0.0.3

func (s Stats) Total() uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL