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 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 TruncateString(s string, maxLength int) string
- func Wrapf(err error, format string, args ...interface{}) error
- type DockerLabelBuilder
- func (b *DockerLabelBuilder) Add(key, value string) *DockerLabelBuilder
- func (b *DockerLabelBuilder) AddIf(condition bool, key, value string) *DockerLabelBuilder
- func (b *DockerLabelBuilder) AddRaw(label string) *DockerLabelBuilder
- func (b *DockerLabelBuilder) AddWithQuotes(key, value, quoteType string) *DockerLabelBuilder
- func (b *DockerLabelBuilder) Build() string
- func (b *DockerLabelBuilder) BuildSlice() []string
- func (b *DockerLabelBuilder) Count() int
- type Error
- type MultiError
- type TraefikLabelBuilder
- func (t *TraefikLabelBuilder) Enable() *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) Entrypoints(entrypoints ...string) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) HealthCheck(path string, interval string) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) HostRule(domain string) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) Port(port int) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) Priority(priority int) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) Service(serviceName string) *TraefikLabelBuilder
- func (t *TraefikLabelBuilder) TLS(certResolver string) *TraefikLabelBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerName ¶
ContainerName generates a standardized container name
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 TruncateString ¶
TruncateString truncates a string to maxLength, adding "..." if truncated
Types ¶
type DockerLabelBuilder ¶
type DockerLabelBuilder struct {
// contains filtered or unexported fields
}
DockerLabelBuilder helps build Docker labels in a type-safe way
func NewDockerLabelBuilder ¶
func NewDockerLabelBuilder() *DockerLabelBuilder
NewDockerLabelBuilder creates a new label builder
func (*DockerLabelBuilder) Add ¶
func (b *DockerLabelBuilder) Add(key, value string) *DockerLabelBuilder
Add adds a label with key and value
func (*DockerLabelBuilder) AddIf ¶
func (b *DockerLabelBuilder) AddIf(condition bool, key, value string) *DockerLabelBuilder
AddIf conditionally adds a label if condition is true
func (*DockerLabelBuilder) AddRaw ¶
func (b *DockerLabelBuilder) AddRaw(label string) *DockerLabelBuilder
AddRaw adds a raw label string (use with caution)
func (*DockerLabelBuilder) AddWithQuotes ¶
func (b *DockerLabelBuilder) AddWithQuotes(key, value, quoteType string) *DockerLabelBuilder
AddWithQuotes adds a label with the value wrapped in the specified quote type quoteType can be "single" or "double"
func (*DockerLabelBuilder) Build ¶
func (b *DockerLabelBuilder) Build() string
Build returns the labels as a space-separated string
func (*DockerLabelBuilder) BuildSlice ¶
func (b *DockerLabelBuilder) BuildSlice() []string
BuildSlice returns the labels as a slice
func (*DockerLabelBuilder) Count ¶
func (b *DockerLabelBuilder) Count() int
Count returns the number of labels
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
type TraefikLabelBuilder ¶
type TraefikLabelBuilder struct {
*DockerLabelBuilder
// contains filtered or unexported fields
}
TraefikLabelBuilder specifically for Traefik labels
func NewTraefikLabelBuilder ¶
func NewTraefikLabelBuilder(routerName, serviceName string) *TraefikLabelBuilder
NewTraefikLabelBuilder creates a builder for Traefik labels
func (*TraefikLabelBuilder) Enable ¶
func (t *TraefikLabelBuilder) Enable() *TraefikLabelBuilder
Enable enables Traefik for this container
func (*TraefikLabelBuilder) Entrypoints ¶
func (t *TraefikLabelBuilder) Entrypoints(entrypoints ...string) *TraefikLabelBuilder
Entrypoints sets the entrypoints for the router
func (*TraefikLabelBuilder) HealthCheck ¶
func (t *TraefikLabelBuilder) HealthCheck(path string, interval string) *TraefikLabelBuilder
HealthCheck adds health check configuration
func (*TraefikLabelBuilder) HostRule ¶
func (t *TraefikLabelBuilder) HostRule(domain string) *TraefikLabelBuilder
HostRule adds a Host() rule for the router
func (*TraefikLabelBuilder) Port ¶
func (t *TraefikLabelBuilder) Port(port int) *TraefikLabelBuilder
Port sets the service port
func (*TraefikLabelBuilder) Priority ¶
func (t *TraefikLabelBuilder) Priority(priority int) *TraefikLabelBuilder
Priority sets the router priority
func (*TraefikLabelBuilder) Service ¶
func (t *TraefikLabelBuilder) Service(serviceName string) *TraefikLabelBuilder
Service links the router to a specific service
func (*TraefikLabelBuilder) TLS ¶
func (t *TraefikLabelBuilder) TLS(certResolver string) *TraefikLabelBuilder
TLS enables TLS for the router