warningcollector

package
v1.134.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWarningCollectionFromContext

func GetWarningCollectionFromContext(ctx context.Context) []string

GetWarningCollectionFromContext retrieves the collection of warnings from the context. If no warnings are found, it returns an empty slice.

func NewWarningCollectorMiddleware

func NewWarningCollectorMiddleware() negroni.HandlerFunc

NewWarningCollectorMiddleware creates a middleware that collects warnings from requests and stores them in the request context for later retrieval.

func WithWarningCollectionToContext

func WithWarningCollectionToContext(ctx context.Context) context.Context

WithWarningCollectionToContext adds a new warnings collection to the context.

Types

type KubernetesWarningHandler

type KubernetesWarningHandler struct {
	sync.Mutex
}

KubernetesWarningHandler is a custom warning handler for Kubernetes API responses. It implements the rest.WarningHandlerWithContext interface to handle warning headers and log them. This handler collects warnings in a thread-safe manner and allows retrieval of warnings from the request context

func NewKubernetesWarningHandler

func NewKubernetesWarningHandler() *KubernetesWarningHandler

NewKubernetesWarningHandler creates a new instance of KubernetesWarningHandler which implements the rest.WarningHandlerWithContext interface. This handler is used to collect warnings from Kubernetes API responses.

func (*KubernetesWarningHandler) HandleWarningHeaderWithContext

func (h *KubernetesWarningHandler) HandleWarningHeaderWithContext(ctx context.Context, code int, agent string, text string)

Jump to

Keyboard shortcuts

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