shared

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFileReadLimit int64 = 96 << 10

DefaultConfigFileReadLimit caps typical config file reads (web server snippets, logrotate, cron, etc.).

Variables

This section is empty.

Functions

func BoolPtr added in v0.5.0

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to b.

func CollectionNote

func CollectionNote(detail string) string

CollectionNote returns a stable human-readable reason (max ~512 chars for schema).

func EnvLocaleC

func EnvLocaleC() []string

EnvLocaleC forces C locale for deterministic CLI output parsing.

func FileExistsRegular added in v0.5.0

func FileExistsRegular(path string) bool

FileExistsRegular reports whether path exists and is not a directory.

func HostIsContainerized added in v0.5.0

func HostIsContainerized() *bool

HostIsContainerized reports dockerenv/cgroup hints (best-effort).

func IntPtr added in v0.5.0

func IntPtr(n int) *int

IntPtr returns a pointer to n.

func QueryDistroPackageVersion added in v0.28.0

func QueryDistroPackageVersion(packageNames []string) string

QueryDistroPackageVersion returns the full distro package version for the first matching package name (e.g., "2.4.57-2~deb12u2" for apache2 on Debian). Tries dpkg-query (Debian/Ubuntu) then rpm (RHEL/CentOS). Returns "" on failure.

func ReadFileBounded added in v0.4.0

func ReadFileBounded(path string, maxBytes int64) ([]byte, error)

ReadFileBounded reads at most maxBytes from path (regular file open).

func ScanContextError added in v0.4.0

func ScanContextError(ctx context.Context) error

ScanContextError returns ctx.Err() when ctx is non-nil and done.

func StringPtr added in v0.5.0

func StringPtr(s string) *string

StringPtr returns a pointer to a copy of s.

func TruncateRunes

func TruncateRunes(s string, max int) string

TruncateRunes truncates to at most max runes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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