Documentation
¶
Index ¶
- func BuildQueries(config Config) ([]dns.Msg, error)
- func BuildTLSConfig(opts cli.Flags) (*tls.Config, func() error, error)
- func NewTransport(server ParsedServer, opts cli.Flags, tlsConfig *tls.Config) (qtransport.Transport, error)
- func Run(ctx context.Context, args []string, stdout, stderr io.Writer) int
- type Config
- type ParseOptions
- type ParsedServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildQueries ¶
BuildQueries constructs one q-compatible DNS message per requested RR type.
func BuildTLSConfig ¶
BuildTLSConfig creates the TLS configuration expected by q transports. The returned cleanup closes the optional TLS key-log file and is always non-nil.
func NewTransport ¶
func NewTransport(server ParsedServer, opts cli.Flags, tlsConfig *tls.Config) (qtransport.Transport, error)
NewTransport creates a q public transport from a normalized server and q flags. Inputs known to trigger log.Fatal inside q are rejected where they can be validated without performing the query itself.
Types ¶
type Config ¶
type Config struct {
Flags cli.Flags
RRTypes []uint16
Warnings []string
EarlyDebugMessages []string
DebugMessages []string
CompletionRequested bool
CompletionVerbose bool
Completions []flags.Completion
}
Config is the normalized q-compatible input consumed by the DNS runner.
func ParseConfig ¶
func ParseConfig(args []string, parseOpts ParseOptions) (Config, error)
ParseConfig parses q arguments without terminating the process on invalid input.
type ParseOptions ¶
type ParseOptions struct {
StdoutIsTerminal bool
HomeDir string
LookupEnv func(string) (string, bool)
ResolverConfigPath string
}
ParseOptions isolates filesystem and environment input for argument parsing.
func DefaultParseOptions ¶
func DefaultParseOptions(stdoutIsTerminal bool) ParseOptions
DefaultParseOptions returns the process-backed parsing dependencies.
type ParsedServer ¶
type ParsedServer struct {
Original string
Address string
TransportType qtransport.Type
Scheme string
Host string
Port string
Path string
ServerName string
FromStamp bool
}
ParsedServer is the normalized server description consumed by the q transport adapter. Address matches the server string q passes to its public transport implementations.
func ParseServer ¶
func ParseServer(server string) (ParsedServer, error)
ParseServer normalizes q-compatible server forms, including DNS stamps, protocol URLs, host names, IPv4 addresses, and scoped IPv6 addresses.