netutils

package
v0.0.0-...-406c194 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MatchFullType   = "full"
	MatchDomainType = "domain"
	MatchRegexType  = "regex"
)

Variables

This section is empty.

Functions

func ContainsNetAddr

func ContainsNetAddr(ns []iplib.Net, ipstr string) bool

func ParseIpNet

func ParseIpNet(d string) (inet iplib.Net, err error)

Types

type DomainList

type DomainList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDomainList

func NewDomainList() *DomainList

func (*DomainList) Add

func (l *DomainList) Add(matchType string, name string) bool

func (*DomainList) Clear

func (l *DomainList) Clear()

func (*DomainList) ForEach

func (l *DomainList) ForEach(f func(name string), max int)

func (*DomainList) FullLen

func (l *DomainList) FullLen() int

func (*DomainList) InitDomainData

func (l *DomainList) InitDomainData(matchType string, items []string)

func (*DomainList) Match

func (l *DomainList) Match(matchType, name string) bool

func (*DomainList) MatchDomain

func (l *DomainList) MatchDomain(name string) bool

func (*DomainList) MatchFull

func (l *DomainList) MatchFull(name string) bool

func (*DomainList) MatchRegex

func (l *DomainList) MatchRegex(name string) bool

func (*DomainList) MixMatch

func (l *DomainList) MixMatch(name string) bool

func (*DomainList) RegexLen

func (l *DomainList) RegexLen() int

type NetList

type NetList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNetList

func NewNetList(data []iplib.Net) *NetList

func (*NetList) Add

func (l *NetList) Add(inet iplib.Net)

func (*NetList) AddByString

func (l *NetList) AddByString(nstr string) bool

func (*NetList) Clear

func (l *NetList) Clear()

func (*NetList) FindNet

func (l *NetList) FindNet(lookingFor iplib.Net) iplib.Net

func (*NetList) ForEach

func (l *NetList) ForEach(f func(net iplib.Net), max int)

func (*NetList) Len

func (l *NetList) Len() int

func (*NetList) MatchNet

func (l *NetList) MatchNet(lookingFor iplib.Net) bool

func (*NetList) Sort

func (l *NetList) Sort()

Jump to

Keyboard shortcuts

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