Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Dec 18, 2024
1 parent fd596f3 commit 7659683
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dnsutils/dnsmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ type PowerDNS struct {
AppliedPolicyType string `json:"applied-policy-type"`
Metadata map[string]string `json:"metadata"`
HTTPVersion string `json:"http-version"`
MessageId string `json:"message-id"`
InitialRequestorId string `json:"initial-requestor-id"`
MessageID string `json:"message-id"`
InitialRequestorID string `json:"initial-requestor-id"`
}

type TransformDNSGeo struct {
Expand Down
4 changes: 2 additions & 2 deletions dnsutils/dnsmessage_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ func TestDnsMessage_Json_Collectors_Reference(t *testing.T) {
Tags: []string{"tag1"},
Metadata: map[string]string{"stream_id": "collector"},
HTTPVersion: "http3",
MessageId: "27c3e94ad6284eec9a50cfc5bd7384d6",
InitialRequestorId: "5e006236c8a74f7eafc6af126e6d0689",
MessageID: "27c3e94ad6284eec9a50cfc5bd7384d6",
InitialRequestorID: "5e006236c8a74f7eafc6af126e6d0689",
}},

jsonRef: `{
Expand Down
8 changes: 4 additions & 4 deletions dnsutils/dnsmessage_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ func (dm *DNSMessage) handlePdnsDirectives(directive string, s *strings.Builder)
s.WriteString("-")
}
case directive == "powerdns-message-id":
if len(dm.PowerDNS.MessageId) > 0 {
s.WriteString(dm.PowerDNS.MessageId)
if len(dm.PowerDNS.MessageID) > 0 {
s.WriteString(dm.PowerDNS.MessageID)
} else {
s.WriteString("-")
}
case directive == "powerdns-initial-requestor-id":
if len(dm.PowerDNS.InitialRequestorId) > 0 {
s.WriteString(dm.PowerDNS.InitialRequestorId)
if len(dm.PowerDNS.InitialRequestorID) > 0 {
s.WriteString(dm.PowerDNS.InitialRequestorID)
} else {
s.WriteString("-")
}
Expand Down
4 changes: 2 additions & 2 deletions dnsutils/dnsmessage_text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,13 @@ func TestDnsMessage_TextFormat_Directives_Pdns(t *testing.T) {
{
name: "message_id",
format: "powerdns-message-id",
dm: DNSMessage{PowerDNS: &PowerDNS{MessageId: "27c3e94ad6284eec9a50cfc5bd7384d6"}},
dm: DNSMessage{PowerDNS: &PowerDNS{MessageID: "27c3e94ad6284eec9a50cfc5bd7384d6"}},
expected: "27c3e94ad6284eec9a50cfc5bd7384d6",
},
{
name: "initial_requestor_id",
format: "powerdns-initial-requester-id",
dm: DNSMessage{PowerDNS: &PowerDNS{InitialRequestorId: "5e006236c8a74f7eafc6af126e6d0689"}},
dm: DNSMessage{PowerDNS: &PowerDNS{InitialRequestorID: "5e006236c8a74f7eafc6af126e6d0689"}},
expected: "5e006236c8a74f7eafc6af126e6d0689",
},
}
Expand Down
4 changes: 2 additions & 2 deletions workers/powerdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ func (w *PdnsProcessor) StartCollect() {
}

// get id
pdns.MessageId = hex.EncodeToString(pbdm.MessageId)
pdns.InitialRequestorId = hex.EncodeToString(pbdm.InitialRequestId)
pdns.MessageID = hex.EncodeToString(pbdm.MessageId)
pdns.InitialRequestorID = hex.EncodeToString(pbdm.InitialRequestId)

// finally set pdns to dns message
dm.PowerDNS = &pdns
Expand Down

0 comments on commit 7659683

Please sign in to comment.