mapper

package
v0.3.1-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAC

func NewAC() *ac

func NewDomainMapper

func NewDomainMapper[T any]() *domain[T]

func NewMapper

func NewMapper[T any](dns dns.DNS) mapper.Mapper[string, proxy.Address, T]

Types

type Cidr

type Cidr[T any] struct {
	// contains filtered or unexported fields
}

Cidr cidr matcher

func NewCidrMapper

func NewCidrMapper[T any]() *Cidr[T]

NewCidrMatchWithTrie <--

func (*Cidr[T]) Insert

func (c *Cidr[T]) Insert(cidr string, mark T) error

InsetOneCIDR Insert one CIDR to cidr matcher

func (*Cidr[T]) InsertCIDR

func (c *Cidr[T]) InsertCIDR(ipNet *net.IPNet, mark T)

func (*Cidr[T]) InsertIP

func (c *Cidr[T]) InsertIP(ip net.IP, maskSize int, mark T)

func (*Cidr[T]) Search

func (c *Cidr[T]) Search(ip string) (mark T, ok bool)

MatchWithTrie match ip with trie

func (*Cidr[T]) SearchIP

func (c *Cidr[T]) SearchIP(ip net.IP) (mark T, ok bool)

type Trie

type Trie[T any] struct {
	// contains filtered or unexported fields
}

******************************

CIDR TRIE

*******************************

func NewTrieTree

func NewTrieTree[T any]() Trie[T]

NewTrieTree create a new trie tree

func (*Trie[T]) Insert

func (t *Trie[T]) Insert(ip net.IP, maskSize int, mark T)

Insert insert node to tree

func (*Trie[T]) PrintTree

func (t *Trie[T]) PrintTree(node *Trie[T])

PrintTree print this tree

func (*Trie[T]) Search

func (t *Trie[T]) Search(ip net.IP) (mark T, ok bool)

Search search from trie tree

Jump to

Keyboard shortcuts

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