ipranger

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 11 Imported by: 0

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

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

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

func (*IPRanger) ContainsAny

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

func (*IPRanger) Delete

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

func (*IPRanger) GetHostsByIP

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

func (*IPRanger) HasIP

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

func (*IPRanger) IsValid

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

func (*IPRanger) Shrink

func (ir *IPRanger) Shrink() error

type Stats

type Stats struct {
	Hosts uint64
	IPS   uint64
	Ports uint64
}

func (Stats) Total

func (s Stats) Total() uint64

Jump to

Keyboard shortcuts

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