Documentation
¶
Overview ¶
Package format provides shared formatting utilities for CLI output and registry allocation field extraction.
Index ¶
- func DisplayName(a Allocation) string
- func DropDatabases(allocs []Allocation)
- func DropSingleDB(alloc Allocation, worktreePath string)
- func GetPorts(a Allocation) []int
- func GetStr(a Allocation, key string) string
- func JoinInts(ints []int, sep string) string
- func PortDisplay(a Allocation) string
- type Allocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayName ¶
func DisplayName(a Allocation) string
DisplayName returns the best human-readable label for an allocation. Prefers branch (if set), falls back to worktree_name.
func DropDatabases ¶
func DropDatabases(allocs []Allocation)
DropDatabases drops databases for the given allocations using the appropriate adapter. Prints warnings to stderr for any failures but continues processing remaining databases.
func DropSingleDB ¶
func DropSingleDB(alloc Allocation, worktreePath string)
DropSingleDB drops the database for a single allocation.
func GetPorts ¶
func GetPorts(a Allocation) []int
GetPorts extracts the port list from an allocation. Returns nil if no ports found. Handles both the "ports" array format and legacy single "port" field.
func GetStr ¶
func GetStr(a Allocation, key string) string
GetStr extracts a string field from an allocation. Returns empty string if not found.
func PortDisplay ¶
func PortDisplay(a Allocation) string
PortDisplay returns a formatted port string like ":3000" or empty if no ports.
Types ¶
type Allocation ¶
Allocation is a map representing a registry entry. Defined here to avoid import cycles between format and registry packages.