utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-2.0, GPL-2.0-only Imports: 6 Imported by: 0

Documentation

Overview

Package utils provides general utility functions used across the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeduplicateSliceOfStrings

func DeduplicateSliceOfStrings(duplicates []string) []string

DeduplicateSliceOfStrings removes duplicate strings and empty strings from a slice.

func FDToInt added in v0.4.0

func FDToInt(fd uintptr) (int, bool)

FDToInt safely converts a file descriptor from uintptr to int. Returns false if the descriptor value cannot be represented by int.

func HumanDuration added in v0.4.0

func HumanDuration(d time.Duration) string

HumanDuration formats a duration into a concise human-readable string while keeping enough precision for performance diagnostics.

func ValidateRuleDirNotEmpty

func ValidateRuleDirNotEmpty(dirPath string) error

ValidateRuleDirNotEmpty checks if a directory exists, is a directory, and contains rule files. Returns an error if the directory doesn't exist, is not a directory, or contains no .yaml/.yml files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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