config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDomain

func ValidateDomain(domain string) error

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

func ValidateName(name string) error

ValidateName validates a service name for security and correctness

func ValidatePath added in v0.1.0

func ValidatePath(path string) error

ValidatePath validates a URL path prefix for Traefik routing

func ValidateServer

func ValidateServer(server string) error

ValidateServer validates a server hostname/identifier Returns an error if the server name contains shell metacharacters or is invalid

func ValidateStackPath

func ValidateStackPath(path string) error

ValidateStackPath validates a stack path for security and correctness

func ValidateVolumeName

func ValidateVolumeName(name string) error

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) ImageName

func (c *Config) ImageName() string

ImageName returns the Docker image name (without tag)

func (*Config) IsPrebuilt

func (c *Config) IsPrebuilt() bool

IsPrebuilt returns true if this config uses a pre-built image

func (*Config) StackPath

func (c *Config) StackPath() string

StackPath returns the full path to the stack directory on the server This is the directory containing compose.yaml

func (*Config) UseHTTPS

func (c *Config) UseHTTPS() bool

UseHTTPS returns true if HTTPS should be used for this config Returns true when HTTPS is nil (default) or explicitly set to true

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

Jump to

Keyboard shortcuts

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