utils

package
v0.0.0-...-4441d29 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration in a human-readable way.

func GenerateAlertID

func GenerateAlertID() string

GenerateAlertID generates a unique alert ID using timestamp and random suffix.

func GenerateAlertIDWithPrefix

func GenerateAlertIDWithPrefix(prefix string) string

GenerateAlertIDWithPrefix generates a unique alert ID with a custom prefix.

func ParseTimeString

func ParseTimeString(timeStr string) (time.Time, error)

ParseTimeString parses various time formats into a time.Time.

func TimeUntilExpiry

func TimeUntilExpiry(expiry time.Time) time.Duration

TimeUntilExpiry returns the duration until the given time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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