util

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackupCounter = NewCounter()

BackupCounter is a global counter for backup naming

Functions

func GenerateSecurePassword

func GenerateSecurePassword(length int) string

func GetSystemResourceLimits

func GetSystemResourceLimits() (int, int, error)

func ParseRAMString

func ParseRAMString(ramStr string) (int, error)

func ValidateBasicResourceBounds

func ValidateBasicResourceBounds(cpuCores, ramMB int) error

func ValidateInstanceName

func ValidateInstanceName(name string) error

ValidateInstanceName checks that a new instance name is safe to embed in Docker names, URLs and file paths. Existing instances are not re-validated.

func ValidateSystemResources

func ValidateSystemResources(cpuCores, ramMB int) error

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter provides monotonic counters for unique naming within the same timestamp

func NewCounter

func NewCounter() *Counter

NewCounter creates a new monotonic counter

func (*Counter) GetNext

func (c *Counter) GetNext(timestamp string) int

GetNext returns the next counter value for a given timestamp

func (*Counter) Len

func (c *Counter) Len() int

Len returns the number of counters (for testing)

Jump to

Keyboard shortcuts

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