id

package
v0.6.47 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Name

id - add request ID to the context

Description

id adds a random request ID to the context. Other handlers such as log use it in the logging if present.

Syntax

id

Examples

example.org {
    id
    any
    whoami
}

Context

The id handler adds a single key to the context:

Key Type Example Description
id/id string 5FOXMDAG6YAHD6R7QOZ4UTX7VQ The ID.

When the log handler is used the ID is automatically logged as id.id=...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(err error) slog.Attr

Types

type Id

type Id int

func (*Id) Err

func (i *Id) Err(err error) error

func (*Id) HandlerFunc

func (i *Id) HandlerFunc(next dns.HandlerFunc) dns.HandlerFunc

func (*Id) Key

func (i *Id) Key() string

Jump to

Keyboard shortcuts

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