add metrics for dns
All checks were successful
test / test (push) Successful in 46s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-09 00:41:08 +03:00
parent d9b822deff
commit b6a0e4d983
7 changed files with 67 additions and 13 deletions

View File

@@ -11,15 +11,13 @@ import (
)
type dnsConn struct {
sync.Mutex
ibuf bytes.Buffer
obuf bytes.Buffer
deadline time.Time
ctx context.Context
cancel context.CancelFunc
deadline time.Time
roundTrip roundTripper
ibuf bytes.Buffer
obuf bytes.Buffer
sync.Mutex
}
type roundTripper func(ctx context.Context, req string) (res string, err error)
@@ -78,8 +76,8 @@ func (c *dnsConn) SetDeadline(t time.Time) error {
func (c *dnsConn) SetReadDeadline(t time.Time) error {
c.Lock()
defer c.Unlock()
c.deadline = t
c.Unlock()
return nil
}