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, ch *middleware.Chain)

ServeDNS implements the Handle interface.

Source Files