resolver

package
v0.17.9 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DnsResolver

type DnsResolver interface {
	Register(domain string) error
	Unregister(domain string)
	Lookup(domain string) ([]net.IP, error)
	Start()
	Close()
}

func NewDnsResolver

func NewDnsResolver(name string, logger logging.LoggerFactory) DnsResolver

NewDnsResolver creates a new DNS resolver

func NewMockResolver added in v0.10.5

func NewMockResolver(zone map[string]([]string), logger logging.LoggerFactory) DnsResolver

NewMockResolver creates a new mock DNS resolver

type MockResolver

type MockResolver struct {
	Zone map[string]([]string)
	// contains filtered or unexported fields
}

for testing

func (*MockResolver) Close added in v0.10.5

func (m *MockResolver) Close()

Close closes the mock resolver

func (*MockResolver) Lookup added in v0.10.5

func (m *MockResolver) Lookup(domain string) ([]net.IP, error)

Lookup returns the hostname(s) for a domain

func (*MockResolver) Register added in v0.10.5

func (m *MockResolver) Register(domain string) error

Register mocks the DNS resolver's Register method

func (*MockResolver) Start added in v0.10.5

func (m *MockResolver) Start()

Starts spawns the mock DNS resolver

func (*MockResolver) Unregister added in v0.10.5

func (m *MockResolver) Unregister(domain string)

Unregister mocks the Unregister method

Jump to

Keyboard shortcuts

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