dnsresolve

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package dnsresolve provides registry chain elements that can resolve passed Domain to URL

Index

Constants

View Source
const DefaultNsmgrProxyService = "nsmgr-proxy.nsm-system"

DefaultNsmgrProxyService default NSM nsmgr proxy service name for SRV lookup

View Source
const DefaultRegistryService = "registry.nsm-system"

DefaultRegistryService default NSM registry service name for SRV lookup

Variables

This section is empty.

Functions

func NewNetworkServiceEndpointRegistryClient added in v1.4.0

func NewNetworkServiceEndpointRegistryClient(opts ...Option) registry.NetworkServiceEndpointRegistryClient

NewNetworkServiceEndpointRegistryClient creates new NetworkServiceEndpointRegistryClient that can resolve passed domain to clienturl

func NewNetworkServiceEndpointRegistryServer

func NewNetworkServiceEndpointRegistryServer(opts ...Option) registry.NetworkServiceEndpointRegistryServer

NewNetworkServiceEndpointRegistryServer creates new NetworkServiceRegistryServer that can resolve passed domain to clienturl

func NewNetworkServiceRegistryClient added in v1.4.0

func NewNetworkServiceRegistryClient(opts ...Option) registry.NetworkServiceRegistryClient

NewNetworkServiceRegistryClient creates new NetworkServiceRegistryClient that can resolve passed domain to clienturl

func NewNetworkServiceRegistryServer

func NewNetworkServiceRegistryServer(opts ...Option) registry.NetworkServiceRegistryServer

NewNetworkServiceRegistryServer creates new NetworkServiceRegistryServer that can resolve passed domain to clienturl

Types

type Option

type Option func(*options)

Option is option to configure dnsresovle chain elements

func WithNSMgrProxyService

func WithNSMgrProxyService(service string) Option

WithNSMgrProxyService sets default service of nsmgr-proxy to lookup DNS SRV records

func WithRegistryService

func WithRegistryService(service string) Option

WithRegistryService sets default service of nsmgr-proxy to lookup DNS SRV records

func WithResolver

func WithResolver(r Resolver) Option

WithResolver sets DNS resolver by default used net.DefaultResolver

type Resolver

type Resolver interface {
	// LookupSRV tries to resolve an SRV query of the given service,
	// protocol, and domain name. The proto is "tcp" or "udp".
	// The returned records are sorted by priority and randomized
	// by weight within a priority.
	LookupSRV(ctx context.Context, service, proto, name string) (string, []*net.SRV, error)
	// LookupIPAddr looks up host using the local resolver.
	// It returns a slice of that host's IPv4 and IPv6 addresses.
	LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error)
}

Resolver is DNS resolver

Jump to

Keyboard shortcuts

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