Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix govet:fieldalignment linting errors #154

Merged
merged 1 commit into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ func (mvf *multiValueFlag) Set(value string) error {
// intended to be retrieved via "Getter" methods.
type Config struct {

// Use our template, define distinct collections of configuration settings
cliConfig configTemplate
fileConfig configTemplate

// configFile represents the fully-qualified path to a configuration file
// consulted for settings not provided via CLI flags
configFile string `toml:"-"`

// Use our template, define distinct collections of configuration settings
cliConfig configTemplate
fileConfig configTemplate

// showVersion is a flag indicating whether the user opted to display only
// the version string and then immediately exit the application
showVersion bool `toml:"-"`
Expand All @@ -208,12 +208,22 @@ type Config struct {
// specified by various configuration sources
type configTemplate struct {

// IgnoreDNSErrors is a boolean *pointer* flag indicating whether
// individual DNS errors should be ignored. If enabled, this setting
// allows query-related DNS errors with one host to not block queries
// against remaining DNS servers. This can be useful to work around
// failures with one server in a pool of many.
DNSErrorsFatal bool `toml:"dns_errors_fatal"`
// LogLevel is the chosen logging level
LogLevel string `toml:"log_level"`

// LogFormat controls which output format is used for log messages
// generated by this application. This value is from a smaller subset
// of the formats supported by the third-party leveled-logging package
// used by this application.
LogFormat string `toml:"log_format"`

// ResultsOutput specifies whether the results summary is composed of a
// single comma-separated line of records for a query, or whether the
// records are returned one per line.
ResultsOutput string `toml:"results_output"`

// Query represents the FQDN query strings submitted to each DNS server
Query string `toml:"query"`

// Servers is a list of the DNS servers used by this application. Most
// commonly set in a configuration file due to the number of servers used
Expand All @@ -226,30 +236,20 @@ type configTemplate struct {
// type (dns.RR).
QueryTypes multiValueFlag `toml:"dns_query_types"`

// Query represents the FQDN query strings submitted to each DNS server
Query string `toml:"query"`

// SrvProtocols is a list of the Service Location (SRV) record protocol
// keywords associated with a given domain name.
SrvProtocols multiValueFlag `toml:"dns_srv_protocols"`

// LogLevel is the chosen logging level
LogLevel string `toml:"log_level"`

// LogFormat controls which output format is used for log messages
// generated by this application. This value is from a smaller subset
// of the formats supported by the third-party leveled-logging package
// used by this application.
LogFormat string `toml:"log_format"`

// ResultsOutput specifies whether the results summary is composed of a
// single comma-separated line of records for a query, or whether the
// records are returned one per line.
ResultsOutput string `toml:"results_output"`

// Timeout is the number of seconds allowed for a DNS query to complete
// before it times out.
Timeout int `toml:"timeout"`

// IgnoreDNSErrors is a boolean *pointer* flag indicating whether
// individual DNS errors should be ignored. If enabled, this setting
// allows query-related DNS errors with one host to not block queries
// against remaining DNS servers. This can be useful to work around
// failures with one server in a pool of many.
DNSErrorsFatal bool `toml:"dns_errors_fatal"`
}

func (c Config) String() string {
Expand Down
18 changes: 9 additions & 9 deletions dqrs/queryresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ import (
// records).
type DNSQueryResponse struct {

// Answer may potentially be composed of multiple Resource Record types
// such as CNAME and A records. We later separate out the types when
// needed.
Answer []dns.RR

// Server is the DNS server used for this query and response.
Server string

// Query is the FQDN that we requested a record for.
Query string

// RequestedRecordType represents the type of record requested as part of
// the query
RequestedRecordType uint16

// Error records whether an error occurred during any part of performing a
// query
QueryError error

// Answer may potentially be composed of multiple Resource Record types
// such as CNAME and A records. We later separate out the types when
// needed.
Answer []dns.RR

// ResponseTime, also known as the Round-trip Time, can be best summed up
// by this Cloudflare definition: "Round-trip time (RTT) is the duration
// in milliseconds (ms) it takes for a network request to go from a
// starting point to a destination and back again to the starting point."
ResponseTime time.Duration

// RequestedRecordType represents the type of record requested as part of
// the query
RequestedRecordType uint16
}

// DNSQueryResponses is a collection of DNS query responses. Intended for
Expand Down