Documentation
¶
Index ¶
- func ValidateDomain(domain string) error
- func ValidateHealthCheck(hc *HealthCheck) error
- func ValidateName(name string) error
- func ValidatePath(path string) error
- func ValidateServer(server string) error
- func ValidateStackPath(path string) error
- func ValidateVolumeName(name string) error
- type Config
- type HealthCheck
- type RootConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDomain ¶
ValidateDomain validates a domain name for security and correctness
func ValidateHealthCheck ¶
func ValidateHealthCheck(hc *HealthCheck) error
ValidateHealthCheck validates a healthcheck configuration for security and correctness
func ValidateName ¶
ValidateName validates a service name for security and correctness
func ValidatePath ¶ added in v0.1.0
ValidatePath validates a URL path prefix for Traefik routing
func ValidateServer ¶
ValidateServer validates a server hostname/identifier Returns an error if the server name contains shell metacharacters or is invalid
func ValidateStackPath ¶
ValidateStackPath validates a stack path for security and correctness
func ValidateVolumeName ¶
ValidateVolumeName validates a Docker volume name for security and correctness
Types ¶
type Config ¶
type Config struct {
Name string `yaml:"name"`
Server string `yaml:"server"`
Stack string `yaml:"stack"`
Dockerfile string `yaml:"dockerfile"`
Context string `yaml:"context"`
Domain string `yaml:"domain"` // optional, enables Traefik
Path string `yaml:"path"` // optional, path prefix for Traefik routing
HTTPS *bool `yaml:"https"` // default true, pointer for nil check
Port int `yaml:"port"` // default 80
Image string `yaml:"image"` // if set, skip build (pre-built)
DependsOn []string `yaml:"depends_on"`
Volumes map[string]string `yaml:"volumes"` // name: mount_path
HealthCheck *HealthCheck `yaml:"healthcheck"`
}
Config represents a single service configuration
func (*Config) IsPrebuilt ¶
IsPrebuilt returns true if this config uses a pre-built image
type HealthCheck ¶
type HealthCheck struct {
Cmd string `yaml:"cmd"`
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
Retries int `yaml:"retries"`
}
HealthCheck represents Docker healthcheck configuration
type RootConfig ¶
type RootConfig struct {
Server string `yaml:"server"`
Stack string `yaml:"stack"`
Services map[string]*Config `yaml:"services"`
}
RootConfig represents the ssd.yaml file structure
func Load ¶
func Load(path string) (*RootConfig, error)
Load reads and parses ssd.yaml from the current directory or specified path
func LoadFromBytes ¶
func LoadFromBytes(data []byte) (*RootConfig, error)
LoadFromBytes parses raw YAML bytes into RootConfig Does not panic on any input, returns error instead Enables fuzz testing without file system
func (*RootConfig) GetService ¶
func (r *RootConfig) GetService(serviceName string) (*Config, error)
GetService returns the configuration for a specific service serviceName is required when Services map exists
func (*RootConfig) IsSingleService ¶
func (r *RootConfig) IsSingleService() bool
IsSingleService returns true if this is a single-service config
func (*RootConfig) ListServices ¶
func (r *RootConfig) ListServices() []string
ListServices returns all service names in a multi-service config