warningcollector

package
v1.116.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 6 Imported by: 0

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