gethost

package
v0.0.0-...-b4c9943 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNSforZone

func GetNSforZone(ctx context.Context, zone string) (ns string, err error)

GetNSforZone returns NameServer for zone by doing NS query to the resolver configured in resolv.conf

func GetRRforZone

func GetRRforZone(ctx context.Context, zone string, hostToGet string, c chan GetRRforZoneResult, config *Config)

GetRRforZone send all CNAME and A records that match 'hostToGet' over channel c. If 'hostToGet' is empty all CNAME and A records for zone z will be returned. This function is well suited to be started in parallel as an go routine.

func JaegerInit

func JaegerInit(service string) (opentracing.Tracer, io.Closer)

JaegerInit initialises jaeger object.

func Zones

func Zones(config *Config) []dns.SOA

Zones returns a pointer to an slice with dns.SOA RR type for the zones to get AXFR from.

Types

type Config

type Config struct {
	Zones      []string
	NS         string // TODO may be able to use nameserver from configfile
	Resolver   string // TODO may be able to use resolver from configfile
	TTL        int    // Timeout in seconds
	ServerPort int    // Port for server to bind to
	ServerURL  string // Url to server, used by client
	Tracing    bool   // Use jaeger tracing
	Verbose    bool   // Print more verbose information
}

Config should be populated from an TOML configuration file. Se example.toml in root of this repo.

func NewConfig

func NewConfig(configFile *string) (*Config, error)

NewConfig returns default configuration with consideration to configuration file.

type GetRRforZoneResult

type GetRRforZoneResult struct {
	SOA SOAwithRR
	Err error
}

GetRRforZoneResult is the return struct for GetRRforZone

type SOAwithRR

type SOAwithRR struct {
	SOA *dns.SOA
	RR  map[string][]dns.RR
}

SOAwithRR is an data structure for selected dns.RR and corresponding SOA

Jump to

Keyboard shortcuts

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