fakeip

package
v0.0.0-...-317432a Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool is a implementation about fake ip generator without storage

func New

func New(ipnet *net.IPNet, size int, host *trie.DomainTrie) (*Pool, error)

New return Pool instance

func (*Pool) Exist

func (p *Pool) Exist(ip net.IP) bool

Exist returns if given ip exists in fake-ip pool

func (*Pool) Gateway

func (p *Pool) Gateway() net.IP

Gateway return gateway ip

func (*Pool) IPNet

func (p *Pool) IPNet() *net.IPNet

IPNet return raw ipnet

func (*Pool) LookBack

func (p *Pool) LookBack(ip net.IP) (string, bool)

LookBack return host with the fake ip

func (*Pool) Lookup

func (p *Pool) Lookup(host string) net.IP

Lookup return a fake ip with host

func (*Pool) LookupHost

func (p *Pool) LookupHost(domain string) bool

LookupHost return if domain in host

func (*Pool) PatchFrom

func (p *Pool) PatchFrom(o *Pool)

PatchFrom clone cache from old pool

Jump to

Keyboard shortcuts

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