dnsctx

package
v0.5.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Funcs

func Funcs(ctx context.Context, m *dns.Msg) *dns.Msg

Funcs iterates over all handlers and run the functions that are set in the context over the message. The possibly modified message is returned.

func Value

func Value(ctx context.Context, key string) any

Value returns the data under key. If key does not contain a slash nil is returned.

func WithFuncValue

func WithFuncValue(ctx context.Context, handler string, f Func) context.Context

WithFuncValue set the Func f in the context under the key <handler>/msgfunc.

func WithValue

func WithValue(ctx context.Context, key string, value any) context.Context

WithValue stores value under the string value key, key must contain a slash and be formatted like "<handler>/xxx". If key does not contain a slash, this function is noop.

Types

type Func

type Func func(*dns.Msg) *dns.Msg

Func is a function that can be set in the context and operates on a dns.Msg.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL