feat: RFC-8427 #171

Merged
sam merged 16 commits from RFC-8427 into master 2022-12-27 20:07:09 +00:00
2 changed files with 2 additions and 3 deletions
Showing only changes of commit 431937d0fe - Show all commits

View file

@ -255,9 +255,8 @@ func MakePrintable(res util.Response, opts *util.Options) (*Message, error) {
ret := &Message{
RTT: res.RTT.String(),
Server: opts.Request.Server + serverExtra(opts),
When: time.Now().Format(time.RFC3339),
DateString: time.Now().Format(time.RFC3339),
DateSeconds: time.Now().Format(time.UnixDate),
DateSeconds: time.Now().Unix(),
MsgSize: res.DNS.Len(),
ID: msg.Id,
Opcode: dns.OpcodeToString[msg.Opcode],

View file

@ -11,7 +11,7 @@ import (
//nolint:govet,tagliatelle // Better looking output is worth a few bytes.
type Message struct {
DateString string `json:"dateString,omitempty" xml:"dateString,omitempty" yaml:"dateString,omitempty"`
DateSeconds string `json:"dateSeconds,omitempty" xml:"dateSeconds,omitempty" yaml:"dateSeconds,omitempty"`
DateSeconds int64 `json:"dateSeconds,omitempty" xml:"dateSeconds,omitempty" yaml:"dateSeconds,omitempty"`
MsgSize int `json:"msgLength,omitempty" xml:"msgSize,omitempty" yaml:"msgSize,omitempty"`
ID uint16 `json:"id," xml:"id," yaml:"id" example:"12"`