Files
dnsproxy/proxy/requesthandler_internal_test.go
T
Dimitry Kolyshev 62d52341bc Pull request: AGDNS-3523-add-context
Merge in GO/dnsproxy from AGDNS-3523-add-context to master

Squashed commit of the following:

commit 59b61ecf791f4d2df54cae143b262112ed7fe241
Author: Dimitry Kolyshev <[email protected]>
Date:   Thu Mar 12 09:20:57 2026 +0700

    proxy: start ctx

commit fe4cbfbc893da6728ab22cef667a70e9180fe15b
Merge: 10c620a b7d4b05
Author: Dimitry Kolyshev <[email protected]>
Date:   Wed Mar 11 07:59:19 2026 +0700

    Merge remote-tracking branch 'origin/master' into AGDNS-3523-add-context

commit 10c620ac414cfdd4d5b1e42279bf18c5b9380f75
Author: Dimitry Kolyshev <[email protected]>
Date:   Tue Mar 10 12:21:06 2026 +0700

    proxy: fix udp

commit 6dbe12058d756479faa11d5b898b86c45117d1c5
Author: Dimitry Kolyshev <[email protected]>
Date:   Fri Mar 6 12:58:47 2026 +0700

    proxy: start ctx

commit 88cf3e781176eec709441e01d81a708c3f2e7f38
Author: Dimitry Kolyshev <[email protected]>
Date:   Thu Mar 5 11:24:26 2026 +0700

    proxy: req ctx constructor

commit f8d8e2662c39b97d4297961e40e833b09e950ed3
Author: Dimitry Kolyshev <[email protected]>
Date:   Tue Mar 3 08:53:28 2026 +0700

    proxy: todo

commit 6e32f1ebb29c54af58b1df8ad927a6babadf497f
Author: Dimitry Kolyshev <[email protected]>
Date:   Mon Mar 2 09:27:03 2026 +0700

    proxy: add context

commit 9e42af8f510c3ab23fe04950265cbcb8e8eba412
Author: Dimitry Kolyshev <[email protected]>
Date:   Sun Mar 1 09:42:30 2026 +0700

    proxy: imp code

commit 29e498d6f8fba668d810987d773624443bb7a51c
Author: Dimitry Kolyshev <[email protected]>
Date:   Tue Feb 24 13:32:27 2026 +0700

    all: add proxy context
2026-03-13 01:26:43 +00:00

20 lines
519 B
Go

package proxy
import "context"
// TestHandler is a mock request handler implementation to simplify
// testing.
//
// TODO(d.kolyshev): Move to internal/dnsproxytest.
type TestHandler struct {
OnHandle func(ctx context.Context, p *Proxy, dctx *DNSContext) (err error)
}
// type check
var _ Handler = (*TestHandler)(nil)
// ServeDNS implements the [Handler] interface for *TestHandler.
func (h *TestHandler) ServeDNS(ctx context.Context, p *Proxy, dctx *DNSContext) (err error) {
return h.OnHandle(ctx, p, dctx)
}