fakeip

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: GPL-3.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v1.8.0

type Options struct {
	IPNet *net.IPNet
	Host  *trie.DomainTrie

	// Size sets the maximum number of entries in memory
	// and does not work if Persistence is true
	Size int

	// Persistence will save the data to disk.
	// Size will not work and record will be fully stored.
	Persistence bool
}

type Pool

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

Pool is an implementation about fake ip generator without storage

func New

func New(options Options) (*Pool, error)

New return Pool instance

func (*Pool) CloneFrom added in v1.8.0

func (p *Pool) CloneFrom(o *Pool)

CloneFrom clone cache from old pool

func (*Pool) Exist added in v0.17.0

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

Exist returns if given ip exists in fake-ip pool

func (*Pool) Gateway added in v0.16.0

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

Gateway return gateway ip

func (*Pool) IPNet added in v1.3.0

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

IPNet return raw ipnet

func (*Pool) LookBack added in v0.16.0

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

LookBack return host with the fake ip

func (*Pool) Lookup added in v0.16.0

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

Lookup return a fake ip with host

func (*Pool) ShouldSkipped added in v1.8.0

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

ShouldSkipped return if domain should be skipped

Jump to

Keyboard shortcuts

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