hostsfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hostsfile

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

Hostsfile contains known host entries.

func New

func New(cfg *config.Config) *Hostsfile

New return new hostfile, it will be hosts file also

func (*Hostsfile) LookupStaticAddr

func (h *Hostsfile) LookupStaticAddr(addr string) []string

LookupStaticAddr looks up the hosts for the given address from the hosts file.

func (*Hostsfile) LookupStaticHostV4

func (h *Hostsfile) LookupStaticHostV4(host string) []net.IP

LookupStaticHostV4 looks up the IPv4 addresses for the given host from the hosts file.

func (*Hostsfile) LookupStaticHostV6

func (h *Hostsfile) LookupStaticHostV6(host string) []net.IP

LookupStaticHostV6 looks up the IPv6 addresses for the given host from the hosts file.

func (*Hostsfile) Name

func (h *Hostsfile) Name() string

Name return middleware name

func (*Hostsfile) ServeDNS

func (h *Hostsfile) ServeDNS(ctx context.Context, dc *ctx.Context)

ServeDNS implements the Handle interface.

Jump to

Keyboard shortcuts

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