aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/server_options.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns/server_options.go')
-rw-r--r--lib/dns/server_options.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/dns/server_options.go b/lib/dns/server_options.go
index 20629c2b..9c042b5a 100644
--- a/lib/dns/server_options.go
+++ b/lib/dns/server_options.go
@@ -31,6 +31,9 @@ const (
DebugLevelConnPacket = 4
)
+// HookFunc define type function that will be triggered on specific event.
+type HookFunc func(answer *Answer)
+
// ServerOptions describes options for running a DNS server.
type ServerOptions struct {
primaryUDP []net.Addr // List of parent name server addresses using UDP.
@@ -53,6 +56,10 @@ type ServerOptions struct {
// TLSPrivateKey contains path to certificate private key file.
TLSPrivateKey string `ini:"dns:server:tls.private_key"`
+ // OnAnswerReceived define the hook to be triggered when server
+ // receive valid answer, before its put to caches.
+ OnAnswerReceived HookFunc `json:"-" ini:"-"`
+
// NameServers contains list of parent name servers.
//
// Answer that does not exist on local will be forwarded to parent