resolver

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V4key = "ipv4"
	V6key = "ipv6"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver added in v1.1.0

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

Resolver ...

func New

func New(tag string, logger logApi.Logger) *Resolver

New returns ResolverService instance

func (*Resolver) AddHost added in v1.1.0

func (r *Resolver) AddHost(hostName string)

AddHost adds a host to maintaining

func (*Resolver) DelHost added in v1.1.0

func (r *Resolver) DelHost(hostName string)

DelHost deletes a host with name hostName from maintaining

func (*Resolver) Dump added in v1.1.0

func (r *Resolver) Dump(w io.Writer)

Dump dumps into writer all hosts with theirs ips

func (*Resolver) DumpPrefix added in v1.1.0

func (r *Resolver) DumpPrefix(w io.Writer, prefix string)

DumpPrefix dumps with prefix into writer all hosts with theirs ips

func (*Resolver) GetIPs added in v1.1.0

func (r *Resolver) GetIPs(hostName string) ([]net.IP, []net.IP)

GetIPs returns a list of IPv4 and IPv6

func (*Resolver) GetIPsStr added in v1.1.0

func (r *Resolver) GetIPsStr(hostName string) ([]string, []string)

GetIPsStr returns a string list of IPv4 and IPv6

func (*Resolver) GetNextIP added in v1.1.0

func (r *Resolver) GetNextIP(hostName string) string

GetNextIP returns next IPv4 for host with name hostName

func (*Resolver) GetNextIP6 added in v1.1.0

func (r *Resolver) GetNextIP6(hostName string) string

GetNextIP6 returns next IPv6 for host with name hostName

func (*Resolver) GetNextIP6WithIdx added in v1.1.0

func (r *Resolver) GetNextIP6WithIdx(hostName string) (string, int)

GetNextIP6WithIdx returns next IPv6 and index for host with name hostName

func (*Resolver) GetNextIPWithIdx added in v1.1.0

func (r *Resolver) GetNextIPWithIdx(hostName string) (string, int)

GetNextIPWithIdx returns next IPv4 and index for host with name hostName

func (*Resolver) LookupSRV added in v1.1.0

func (r *Resolver) LookupSRV(service, proto, name string) (string, []*net.SRV, error)

LookupSRV makes LookupSRV request to one of nameserver passed to WithNameservers

func (*Resolver) Stop added in v1.1.0

func (r *Resolver) Stop()

Stop - stops maintaining for all hosts

func (*Resolver) UpdateHostsFromMaping added in v1.1.1

func (r *Resolver) UpdateHostsFromMaping(mapping map[string]map[string][]string)

func (*Resolver) WithNameservers added in v1.1.0

func (r *Resolver) WithNameservers(nameServers ...string) *Resolver

WithNameservers - sets nameservers to resolve hosts

Jump to

Keyboard shortcuts

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