chore: always pass context when resolve dns

This commit is contained in:
wwqgtxx
2022-11-12 13:18:36 +08:00
parent dbadf37823
commit 901a47318d
20 changed files with 156 additions and 135 deletions

View File

@ -1,6 +1,8 @@
package context
import (
"context"
"github.com/gofrs/uuid"
"github.com/miekg/dns"
)
@ -12,14 +14,18 @@ const (
)
type DNSContext struct {
context.Context
id uuid.UUID
msg *dns.Msg
tp string
}
func NewDNSContext(msg *dns.Msg) *DNSContext {
func NewDNSContext(ctx context.Context, msg *dns.Msg) *DNSContext {
id, _ := uuid.NewV4()
return &DNSContext{
Context: ctx,
id: id,
msg: msg,
}