Pull request 1938: AG-24132-rdns-ttl
Squashed commit of the following:
commit ba1e7b12cf7c0dc3ffab508d59c149f6c0930548
Merge: 8a94433ec ed86af582
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Tue Jul 25 13:43:25 2023 +0300
Merge branch 'master' into AG-24132-rdns-ttl
commit 8a94433ec119d2158c166dd0222f57917908f3ad
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Mon Jul 24 19:30:21 2023 +0300
all: imp docs
commit 4c1a3676b7be7ac4295c4e28550ddb6eb79a35d4
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Mon Jul 24 13:13:34 2023 +0300
all: add rdns ttl
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/client"
|
||||
@@ -131,14 +132,14 @@ func (r *Resolver) LookupIP(ctx context.Context, network, host string) (ips []ne
|
||||
|
||||
// Exchanger is a fake [rdns.Exchanger] implementation for tests.
|
||||
type Exchanger struct {
|
||||
OnExchange func(ip netip.Addr) (host string, err error)
|
||||
OnExchange func(ip netip.Addr) (host string, ttl time.Duration, err error)
|
||||
}
|
||||
|
||||
// type check
|
||||
var _ rdns.Exchanger = (*Exchanger)(nil)
|
||||
|
||||
// Exchange implements [rdns.Exchanger] interface for *Exchanger.
|
||||
func (e *Exchanger) Exchange(ip netip.Addr) (host string, err error) {
|
||||
func (e *Exchanger) Exchange(ip netip.Addr) (host string, ttl time.Duration, err error) {
|
||||
return e.OnExchange(ip)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user