Documentation
¶
Index ¶
- func ContainerName(project, environment, service string, replica int) string
- func Errorf(format string, args ...interface{}) error
- func ImageTag(project, service, version, environment string) string
- func IsValidUnixUsername(name string) bool
- func JoinNonEmpty(sep string, parts ...string) string
- func NetworkName(project, environment string) string
- func Quote(s string) string
- func SanitizeDomainForLabel(domain string) string
- func SanitizeName(name string) string
- func ShellQuote(s string) string
- func TruncateString(s string, maxLength int) string
- func Wrapf(err error, format string, args ...interface{}) error
- type Error
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerName ¶
ContainerName generates a standardized container name
func IsValidUnixUsername ¶ added in v0.2.4
IsValidUnixUsername validates that a string is a safe POSIX username. Rules: starts with letter or underscore, contains only letters, digits, underscores, and hyphens, max 32 characters.
func JoinNonEmpty ¶
JoinNonEmpty joins non-empty strings with a separator
func NetworkName ¶
NetworkName generates a standardized network name
func SanitizeDomainForLabel ¶
SanitizeDomainForLabel converts a domain to a safe label name Example: "app.example.com" → "app-example-com"
func SanitizeName ¶
SanitizeName sanitizes a string for use in Docker/network names Replaces invalid characters with underscores
func ShellQuote ¶ added in v0.2.4
ShellQuote wraps a string in single quotes with proper escaping for safe use in shell commands. Single quotes within the string are handled by ending the quoted section, adding an escaped single quote, and resuming quoting.
func TruncateString ¶
TruncateString truncates a string to maxLength, adding "..." if truncated
Types ¶
type Error ¶
type Error struct {
Operation string // What operation was being performed
Cause error // The underlying error
Details []string // Additional context
}
Error represents a Tako CLI error with context
type MultiError ¶
type MultiError struct {
Errors []error
}
Multi error type for collecting multiple errors
func (*MultiError) ErrorOrNil ¶
func (m *MultiError) ErrorOrNil() error
ErrorOrNil returns the error if there are any, otherwise nil
func (*MultiError) HasErrors ¶
func (m *MultiError) HasErrors() bool
HasErrors returns true if there are any errors