warning

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package warning is used to handle HTTP warning headers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHook

func DefaultHook() *func(context.Context, *slog.Logger, string)

func Handle

func Handle(ctx context.Context, slog *slog.Logger, msg string)

func NewContext

func NewContext(ctx context.Context, w *Warning) context.Context

func NewHook

func NewHook(log *slog.Logger) *func(context.Context, *slog.Logger, string)

Types

type Warning

type Warning struct {
	List []string
	Hook *func(context.Context, *slog.Logger, string)
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) *Warning

func (*Warning) Handle

func (w *Warning) Handle(ctx context.Context, slog *slog.Logger, msg string)

Jump to

Keyboard shortcuts

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