utils

package
v0.3.2-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountConcurrentPlaygroundSessions

func CountConcurrentPlaygroundSessions() int

CountConcurrentPlaygroundSessions returns the number of other builder-playground start/cook processes currently running (excluding this process). This is used to offset ports for parallel sessions to avoid conflicts.

func GeneratePetName

func GeneratePetName() string

GeneratePetName generates a random pet name like perfect-bee. These names are useful as human friendly identifiers.

func GetLogsDir

func GetLogsDir(sessionID string) (string, error)

GetLogsDir returns the directory where service logs are stored.

func GetPlaygroundDir

func GetPlaygroundDir() (string, error)

GetPlaygroundDir returns the base directory for builder-playground state. It follows XDG Base Directory Specification, defaulting to ~/.local/state/builder-playground.

func GetSessionTempDirCount

func GetSessionTempDirCount() int

GetSessionTempDirCount returns the number of session directories under the playground temp dir.

func GetSessionsDir

func GetSessionsDir() (string, error)

GetSessionsDir returns the directory for all sessions.

func MustGetPlaygroundTempDir

func MustGetPlaygroundTempDir() string

MustGetPlaygroundTempDir creates the temp dir for

func MustGetTempSessionDir

func MustGetTempSessionDir(sessionID string) string

MustGetSessionTempDir creates and returns the temp dir for the session under the temp playground dir.

func MustGetVolumeDir

func MustGetVolumeDir(sessionID, volumeName string) string

MustGetVolumeDir creates and returns the temp dir for bind mount volumes under the temp session dir.

func StartTimer

func StartTimer(name string) func()

StartTimer starts a timer with the given name and returns a function that prints the elapsed time when called. The elapsed time is only printed if debug or trace levels are used.

func TempPlaygroundDirPath

func TempPlaygroundDirPath() string

TempPlaygroundDirPath returns the temp playground dir path.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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