utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPanic = errors.New("recovered from panic")

ErrPanic wraps every error produced by a recovered panic, so callers can classify them with errors.Is.

Functions

func BpfLSMEnabled

func BpfLSMEnabled() (bool, error)

BpfLSMEnabled reports whether "bpf" is in the kernel's active LSM list. A non-nil error means the list could not be read at all, which callers must not treat as "disabled": the usual cause is securityfs being unmounted in the current mount namespace, and the kernel underneath may well have BPF-LSM on.

func DiffSlice

func DiffSlice[T comparable](a, b []T) []T

return the entries in array b and not a

func Guard

func Guard(op string, fn func() error) (err error)

Guard runs fn and converts a panic into an error, preserving the panic stack.

func MergeMapCount

func MergeMapCount[T comparable](dst map[T]uint32, src map[T]uint32)

Types

This section is empty.

Jump to

Keyboard shortcuts

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