Documentation
¶
Index ¶
- func IsNFSVolume(volumeSpec string) bool
- func LoadEnvFile(path string) (map[string]string, error)
- func MergeEnvVars(explicitEnv map[string]string, envFileVars map[string]string) map[string]string
- func ParseNFSVolumeSpec(volumeSpec string) (exportName string, containerPath string, readOnly bool, err error)
- func SaveConfig(configPath string, cfg *Config) error
- func ValidateConfig(cfg *Config) error
- type BackupConfig
- type CacheConfig
- type Config
- func (c *Config) GetAllDefinedVolumes() map[string]VolumeConfig
- func (c *Config) GetDefaultEnvironment() string
- func (c *Config) GetDeploymentStrategy() string
- func (c *Config) GetEnvironment(name string) (*EnvironmentConfig, error)
- func (c *Config) GetEnvironmentServers(envName string) ([]string, error)
- func (c *Config) GetFullImageName(serviceName string, envName string) string
- func (c *Config) GetManagerServer(envName string) (string, error)
- func (c *Config) GetMaxConcurrentBuilds() int
- func (c *Config) GetMaxConcurrentDeploys() int
- func (c *Config) GetNFSConfig() *NFSConfig
- func (c *Config) GetNFSExport(name string) (*NFSExportConfig, error)
- func (c *Config) GetNFSExports() []NFSExportConfig
- func (c *Config) GetNFSServerName(envName string) (string, error)
- func (c *Config) GetRegistryURL() string
- func (c *Config) GetService(envName string, serviceName string) (*ServiceConfig, error)
- func (c *Config) GetServices(envName string) (map[string]ServiceConfig, error)
- func (c *Config) GetVolume(name string) (*VolumeConfig, bool)
- func (c *Config) GetVolumeName(volumeKey, envName string) string
- func (c *Config) IsCacheEnabled() bool
- func (c *Config) IsMultiServer() bool
- func (c *Config) IsNFSEnabled() bool
- func (c *Config) IsParallelDeployment() bool
- func (c *Config) IsVolumeExternal(name string) bool
- func (c *Config) PopulateServersFromInfrastructure(takoDir string) error
- type DeployConfig
- type DeploymentConfig
- type EnvironmentConfig
- type HealthCheckConfig
- type HooksConfig
- type InfraBucketSpec
- type InfraCDNConfig
- type InfraCDNOrigin
- type InfraCredentialsConfig
- type InfraDefaultsConfig
- type InfraFirewallConfig
- type InfraFirewallRule
- type InfraNetworkingConfig
- type InfraServerSpec
- type InfraStateConfig
- type InfraStorageConfig
- type InfraVPCConfig
- type InfrastructureConfig
- type LoadBalancerConfig
- type LoadBalancerHealthCheck
- type MonitoringConfig
- type NFSConfig
- type NFSExportConfig
- type NotificationsConfig
- type ParallelConfig
- type PlacementConfig
- type ProjectConfig
- type ProxyConfig
- type SecretConfig
- type ServerConfig
- type ServerSelector
- type ServiceConfig
- type StorageConfig
- type TLSConfig
- type VolumeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNFSVolume ¶ added in v0.1.2
IsNFSVolume checks if a volume spec refers to an NFS volume (nfs:name:/path format)
func LoadEnvFile ¶
LoadEnvFile reads a .env file and returns a map of environment variables Supports: - KEY=value format - Comments (lines starting with #) - Empty lines - Single and double quoted values - Variable expansion ${VAR} syntax
func MergeEnvVars ¶
MergeEnvVars merges environment variables from multiple sources Priority (highest to lowest): 1. Explicit env vars from config (service.Env) 2. Variables from envFile (service.EnvFile) 3. System environment variables (already expanded via ${VAR} syntax)
func ParseNFSVolumeSpec ¶ added in v0.1.2
func ParseNFSVolumeSpec(volumeSpec string) (exportName string, containerPath string, readOnly bool, err error)
ParseNFSVolumeSpec parses an NFS volume specification Format: nfs:export_name:/container/path[:ro] Returns: exportName, containerPath, readOnly, error
func SaveConfig ¶ added in v0.2.0
SaveConfig writes the configuration to a YAML or JSON file based on extension
func ValidateConfig ¶
ValidateConfig validates the configuration
Types ¶
type BackupConfig ¶
type BackupConfig struct {
Schedule string `yaml:"schedule" json:"schedule"` // cron format (e.g., "0 2 * * *")
Retain int `yaml:"retain" json:"retain"` // days to retain backups
}
BackupConfig defines per-service backup settings
type CacheConfig ¶
type CacheConfig struct {
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` // Enable build caching (default: true)
Type string `yaml:"type,omitempty" json:"type,omitempty"` // "local" (default), "registry"
Retention string `yaml:"retention,omitempty" json:"retention,omitempty"` // Cache retention period (e.g., "7d")
}
CacheConfig defines build caching settings
type Config ¶
type Config struct {
Schema string `yaml:"$schema,omitempty" json:"$schema,omitempty"` // JSON Schema reference
Project ProjectConfig `yaml:"project" json:"project"`
Infrastructure *InfrastructureConfig `yaml:"infrastructure,omitempty" json:"infrastructure,omitempty"` // Cloud infrastructure provisioning
Deployment *DeploymentConfig `yaml:"deployment,omitempty" json:"deployment,omitempty"`
Notifications *NotificationsConfig `yaml:"notifications,omitempty" json:"notifications,omitempty"`
Storage *StorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"`
Volumes map[string]VolumeConfig `yaml:"volumes,omitempty" json:"volumes,omitempty"` // Top-level volume definitions
Servers map[string]ServerConfig `yaml:"servers" json:"servers"`
Environments map[string]EnvironmentConfig `yaml:"environments" json:"environments"`
}
Config represents the main configuration structure
func LoadConfig ¶
LoadConfig loads the configuration from a YAML or JSON file
func LoadConfigWithInfra ¶ added in v0.2.0
LoadConfigWithInfra loads config and populates servers from infrastructure state This is the recommended way to load config when infrastructure is involved
func (*Config) GetAllDefinedVolumes ¶ added in v0.1.3
func (c *Config) GetAllDefinedVolumes() map[string]VolumeConfig
GetAllDefinedVolumes returns all top-level volume definitions
func (*Config) GetDefaultEnvironment ¶
GetDefaultEnvironment returns the default environment name Returns "production" if it exists, otherwise the first environment
func (*Config) GetDeploymentStrategy ¶
GetDeploymentStrategy returns the deployment strategy (parallel or sequential)
func (*Config) GetEnvironment ¶
func (c *Config) GetEnvironment(name string) (*EnvironmentConfig, error)
GetEnvironment retrieves a specific environment configuration If name is empty, returns the default environment
func (*Config) GetEnvironmentServers ¶
GetEnvironmentServers returns the list of servers for an environment
func (*Config) GetFullImageName ¶
GetFullImageName returns the full image name with registry and environment tag
func (*Config) GetManagerServer ¶
GetManagerServer returns the manager server for a given environment
func (*Config) GetMaxConcurrentBuilds ¶
GetMaxConcurrentBuilds returns the max concurrent builds configuration
func (*Config) GetMaxConcurrentDeploys ¶
GetMaxConcurrentDeploys returns the max concurrent deploys configuration
func (*Config) GetNFSConfig ¶ added in v0.1.2
GetNFSConfig returns the NFS configuration, or nil if not enabled
func (*Config) GetNFSExport ¶ added in v0.1.2
func (c *Config) GetNFSExport(name string) (*NFSExportConfig, error)
GetNFSExport returns a specific NFS export by name
func (*Config) GetNFSExports ¶ added in v0.1.2
func (c *Config) GetNFSExports() []NFSExportConfig
GetNFSExports returns all NFS exports
func (*Config) GetNFSServerName ¶ added in v0.1.2
GetNFSServerName returns the NFS server name If "auto" or empty, returns the manager server name for the given environment
func (*Config) GetRegistryURL ¶
GetRegistryURL returns the auto-configured local registry URL Returns empty string for single-server deployments (no registry needed)
func (*Config) GetService ¶
func (c *Config) GetService(envName string, serviceName string) (*ServiceConfig, error)
GetService returns a specific service from an environment
func (*Config) GetServices ¶
func (c *Config) GetServices(envName string) (map[string]ServiceConfig, error)
GetServices returns services for a specific environment
func (*Config) GetVolume ¶ added in v0.1.3
func (c *Config) GetVolume(name string) (*VolumeConfig, bool)
GetVolume returns a volume configuration by name
func (*Config) GetVolumeName ¶ added in v0.1.3
GetVolumeName returns the actual Docker volume name for a defined volume If the volume has a custom name, use it; otherwise, apply project/env prefix
func (*Config) IsCacheEnabled ¶
IsCacheEnabled returns true if build caching is enabled
func (*Config) IsMultiServer ¶
IsMultiServer returns true if more than one server is configured
func (*Config) IsNFSEnabled ¶ added in v0.1.2
IsNFSEnabled returns true if NFS storage is enabled
func (*Config) IsParallelDeployment ¶
IsParallelDeployment returns true if parallel deployment is enabled
func (*Config) IsVolumeExternal ¶ added in v0.1.3
IsVolumeExternal checks if a volume is marked as external
func (*Config) PopulateServersFromInfrastructure ¶ added in v0.2.0
PopulateServersFromInfrastructure populates the Servers map from infrastructure outputs This bridges the gap between infrastructure provisioning and server configuration It reads the infrastructure state from .tako/infra/state.json and creates ServerConfig entries
type DeployConfig ¶
type DeployConfig struct {
Strategy string `yaml:"strategy" json:"strategy"` // blue-green or rolling
}
DeployConfig defines deployment strategy
type DeploymentConfig ¶
type DeploymentConfig struct {
Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"` // "parallel" or "sequential" (default: sequential)
Parallel *ParallelConfig `yaml:"parallel,omitempty" json:"parallel,omitempty"`
Cache *CacheConfig `yaml:"cache,omitempty" json:"cache,omitempty"`
}
DeploymentConfig defines deployment optimization settings
type EnvironmentConfig ¶
type EnvironmentConfig struct {
Servers []string `yaml:"servers" json:"servers"` // List of server names to use
ServerSelector *ServerSelector `yaml:"serverSelector,omitempty" json:"serverSelector,omitempty"` // Label-based server selection
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"` // Environment labels for Docker nodes
Services map[string]ServiceConfig `yaml:"services" json:"services"` // Services to deploy in this environment
}
EnvironmentConfig defines an environment (production, staging, etc.)
type HealthCheckConfig ¶
type HealthCheckConfig struct {
Path string `yaml:"path" json:"path"`
Interval string `yaml:"interval" json:"interval"`
Timeout string `yaml:"timeout" json:"timeout"`
Retries int `yaml:"retries" json:"retries"`
StartPeriod string `yaml:"startPeriod,omitempty" json:"startPeriod,omitempty"` // Grace period before starting checks
}
HealthCheckConfig defines health check settings
type HooksConfig ¶
type HooksConfig struct {
PreBuild []string `yaml:"preBuild,omitempty" json:"preBuild,omitempty"` // Before building Docker image
PostBuild []string `yaml:"postBuild,omitempty" json:"postBuild,omitempty"` // After building Docker image
PreDeploy []string `yaml:"preDeploy,omitempty" json:"preDeploy,omitempty"` // Before deploying service to swarm
PostDeploy []string `yaml:"postDeploy,omitempty" json:"postDeploy,omitempty"` // After deploying service to swarm
PostStart []string `yaml:"postStart,omitempty" json:"postStart,omitempty"` // After service is running (can use docker exec)
}
HooksConfig defines per-service pre/post deployment hooks
type InfraBucketSpec ¶ added in v0.2.0
type InfraBucketSpec struct {
Region string `yaml:"region,omitempty" json:"region,omitempty"` // Override region (defaults to infra region)
ACL string `yaml:"acl,omitempty" json:"acl,omitempty"` // Access: private, public-read (default: private)
CORS bool `yaml:"cors,omitempty" json:"cors,omitempty"` // Enable CORS for web access
}
InfraBucketSpec defines a storage bucket
type InfraCDNConfig ¶ added in v0.2.0
type InfraCDNConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Origins map[string]InfraCDNOrigin `yaml:"origins,omitempty" json:"origins,omitempty"` // Named CDN origins
}
InfraCDNConfig defines CDN configuration
type InfraCDNOrigin ¶ added in v0.2.0
type InfraCDNOrigin struct {
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty"` // Reference to storage bucket
Domain string `yaml:"domain,omitempty" json:"domain,omitempty"` // Custom origin domain
TTL int `yaml:"ttl,omitempty" json:"ttl,omitempty"` // Cache TTL in seconds (default: 86400)
}
InfraCDNOrigin defines a CDN origin (bucket or custom)
type InfraCredentialsConfig ¶ added in v0.2.0
type InfraCredentialsConfig struct {
Token string `yaml:"token,omitempty" json:"token,omitempty"` // API token (DO, Hetzner, Linode) - defaults to env var
AccessKey string `yaml:"accessKey,omitempty" json:"accessKey,omitempty"` // AWS access key
SecretKey string `yaml:"secretKey,omitempty" json:"secretKey,omitempty"` // AWS secret key
ProjectID string `yaml:"projectId,omitempty" json:"projectId,omitempty"` // Project/Account ID if needed
}
InfraCredentialsConfig holds provider authentication
type InfraDefaultsConfig ¶ added in v0.2.0
type InfraDefaultsConfig struct {
Size string `yaml:"size,omitempty" json:"size,omitempty"` // Default size: small, medium, large, xlarge
Image string `yaml:"image,omitempty" json:"image,omitempty"` // Default OS image (auto-detected if empty)
SSHKeys []string `yaml:"ssh_keys,omitempty" json:"ssh_keys,omitempty"` // Default SSH key fingerprints for cloud provider
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"` // Default tags applied to all servers
}
InfraDefaultsConfig provides default values for server specs
type InfraFirewallConfig ¶ added in v0.2.0
type InfraFirewallConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Name string `yaml:"name,omitempty" json:"name,omitempty"` // Firewall name (auto-generated if empty)
Rules []InfraFirewallRule `yaml:"rules,omitempty" json:"rules,omitempty"`
}
InfraFirewallConfig defines firewall rules
type InfraFirewallRule ¶ added in v0.2.0
type InfraFirewallRule struct {
Protocol string `yaml:"protocol" json:"protocol"` // tcp, udp, icmp
Ports []int `yaml:"ports,omitempty" json:"ports,omitempty"` // Port numbers (empty = all)
Sources []string `yaml:"sources,omitempty" json:"sources,omitempty"` // CIDR addresses (e.g., 0.0.0.0/0)
}
InfraFirewallRule defines a single firewall rule
type InfraNetworkingConfig ¶ added in v0.2.0
type InfraNetworkingConfig struct {
VPC *InfraVPCConfig `yaml:"vpc,omitempty" json:"vpc,omitempty"`
Firewall *InfraFirewallConfig `yaml:"firewall,omitempty" json:"firewall,omitempty"`
}
InfraNetworkingConfig defines network resources
type InfraServerSpec ¶ added in v0.2.0
type InfraServerSpec struct {
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"` // Override provider (for multi-cloud setups)
Region string `yaml:"region,omitempty" json:"region,omitempty"` // Override region (for multi-region/multi-cloud)
Size string `yaml:"size,omitempty" json:"size,omitempty"` // Size: small, medium, large, xlarge (or provider-specific)
Image string `yaml:"image,omitempty" json:"image,omitempty"` // OS image (uses default if empty)
Role string `yaml:"role,omitempty" json:"role,omitempty"` // "manager" or "worker" (default: worker)
Count int `yaml:"count,omitempty" json:"count,omitempty"` // Number of servers (default: 1)
SSHKeys []string `yaml:"ssh_keys,omitempty" json:"ssh_keys,omitempty"` // SSH key fingerprints (uses defaults if empty)
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"` // Server tags/labels
UserData string `yaml:"userData,omitempty" json:"userData,omitempty"` // Cloud-init script
}
InfraServerSpec defines a server to be provisioned
type InfraStateConfig ¶ added in v0.2.0
type InfraStateConfig struct {
Backend string `yaml:"backend,omitempty" json:"backend,omitempty"` // "local" (default), "s3", or "manager"
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty"` // S3 bucket name for s3 backend
Region string `yaml:"region,omitempty" json:"region,omitempty"` // S3 region (defaults to infra region)
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty"` // Custom S3 endpoint (for DO Spaces, Linode Object Storage)
Encrypt bool `yaml:"encrypt,omitempty" json:"encrypt,omitempty"` // Enable state encryption (default: true for remote backends)
AccessKey string `yaml:"accessKey,omitempty" json:"accessKey,omitempty"` // S3 access key (defaults to provider credentials)
SecretKey string `yaml:"secretKey,omitempty" json:"secretKey,omitempty"` // S3 secret key (defaults to provider credentials)
}
InfraStateConfig defines where Pulumi state is stored
type InfraStorageConfig ¶ added in v0.2.0
type InfraStorageConfig struct {
Buckets map[string]InfraBucketSpec `yaml:"buckets,omitempty" json:"buckets,omitempty"` // Named bucket definitions
}
InfraStorageConfig defines object storage (S3-compatible buckets)
type InfraVPCConfig ¶ added in v0.2.0
type InfraVPCConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Name string `yaml:"name,omitempty" json:"name,omitempty"` // VPC name (auto-generated if empty)
IPRange string `yaml:"ip_range,omitempty" json:"ip_range,omitempty"` // CIDR (e.g., 10.0.0.0/16)
}
InfraVPCConfig defines VPC/private network settings
type InfrastructureConfig ¶ added in v0.2.0
type InfrastructureConfig struct {
Provider string `yaml:"provider" json:"provider"` // digitalocean, hetzner, aws, linode
Region string `yaml:"region" json:"region"` // Provider-specific region (or friendly name like "nyc", "frankfurt")
Credentials InfraCredentialsConfig `yaml:"credentials,omitempty" json:"credentials,omitempty"` // Provider credentials (can use env vars)
SSHKey string `yaml:"ssh_key,omitempty" json:"ssh_key,omitempty"` // Local SSH key path for connecting to provisioned servers
SSHUser string `yaml:"ssh_user,omitempty" json:"ssh_user,omitempty"` // SSH user (default: root)
Defaults *InfraDefaultsConfig `yaml:"defaults,omitempty" json:"defaults,omitempty"` // Default values for servers
Servers map[string]InfraServerSpec `yaml:"servers" json:"servers"` // Server definitions
Networking *InfraNetworkingConfig `yaml:"networking,omitempty" json:"networking,omitempty"`
Storage *InfraStorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"` // Object storage (S3-compatible)
CDN *InfraCDNConfig `yaml:"cdn,omitempty" json:"cdn,omitempty"` // CDN configuration
State *InfraStateConfig `yaml:"state,omitempty" json:"state,omitempty"` // State backend configuration (for multi-machine sync)
}
InfrastructureConfig defines cloud infrastructure provisioning settings
type LoadBalancerConfig ¶
type LoadBalancerConfig struct {
Strategy string `yaml:"strategy" json:"strategy"` // round_robin, least_conn, ip_hash, random
HealthCheck LoadBalancerHealthCheck `yaml:"healthCheck,omitempty" json:"healthCheck,omitempty"`
}
LoadBalancerConfig defines load balancing settings
type LoadBalancerHealthCheck ¶
type LoadBalancerHealthCheck struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Path string `yaml:"path" json:"path"`
Interval string `yaml:"interval" json:"interval"`
}
LoadBalancerHealthCheck defines load balancer health check settings
type MonitoringConfig ¶
type MonitoringConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"` // Enable monitoring for this service
Interval string `yaml:"interval,omitempty" json:"interval,omitempty"` // Check interval (e.g., "60s")
Webhook string `yaml:"webhook,omitempty" json:"webhook,omitempty"` // Webhook URL for alerts
CheckType string `yaml:"checkType,omitempty" json:"checkType,omitempty"` // "http" or "container" (default: auto-detect)
}
MonitoringConfig defines per-service monitoring settings
type NFSConfig ¶ added in v0.1.2
type NFSConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Server string `yaml:"server,omitempty" json:"server,omitempty"` // "auto" = use manager node, or specify server name
Exports []NFSExportConfig `yaml:"exports,omitempty" json:"exports,omitempty"`
}
NFSConfig defines NFS shared storage settings
type NFSExportConfig ¶ added in v0.1.2
type NFSExportConfig struct {
Name string `yaml:"name" json:"name"` // Name of the export (used in volume references)
Path string `yaml:"path" json:"path"` // Path on the NFS server
Size string `yaml:"size,omitempty" json:"size,omitempty"` // Optional: expected size for provisioning hints
Options []string `yaml:"options,omitempty" json:"options,omitempty"` // NFS export options (e.g., rw, sync, no_subtree_check)
}
NFSExportConfig defines an NFS export/share
type NotificationsConfig ¶ added in v0.0.3
type NotificationsConfig struct {
Slack string `yaml:"slack,omitempty" json:"slack,omitempty"` // Slack webhook URL
Discord string `yaml:"discord,omitempty" json:"discord,omitempty"` // Discord webhook URL
Webhook string `yaml:"webhook,omitempty" json:"webhook,omitempty"` // Generic webhook URL
}
NotificationsConfig defines notification settings
type ParallelConfig ¶
type ParallelConfig struct {
MaxConcurrentBuilds int `yaml:"maxConcurrentBuilds,omitempty" json:"maxConcurrentBuilds,omitempty"` // Default: 4
MaxConcurrentDeploys int `yaml:"maxConcurrentDeploys,omitempty" json:"maxConcurrentDeploys,omitempty"` // Default: 4
Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"` // "dependency-aware" (default), "resource-aware", "round-robin"
}
ParallelConfig defines parallel deployment settings
type PlacementConfig ¶
type PlacementConfig struct {
Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"` // "spread", "pinned", "any"
Servers []string `yaml:"servers,omitempty" json:"servers,omitempty"` // Pin to specific servers (for "pinned" strategy)
Constraints []string `yaml:"constraints,omitempty" json:"constraints,omitempty"` // Docker Swarm constraints (e.g., "node.labels.type==high-memory")
Preferences []string `yaml:"preferences,omitempty" json:"preferences,omitempty"` // Docker Swarm placement preferences (e.g., "spread=node.labels.region")
}
PlacementConfig defines where service replicas should run
type ProjectConfig ¶
type ProjectConfig struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
}
ProjectConfig defines project metadata
type ProxyConfig ¶
type ProxyConfig struct {
// Domain is the primary domain where traffic is served (recommended)
// Use this with RedirectFrom for cleaner configuration
Domain string `yaml:"domain,omitempty" json:"domain,omitempty"`
// RedirectFrom specifies domains that should redirect to the primary Domain
// These domains will get their own TLS certificates and 301 redirect to Domain
// Example: ["www.example.com", "old.example.com"] -> redirects to "example.com"
RedirectFrom []string `yaml:"redirectFrom,omitempty" json:"redirectFrom,omitempty"`
// Domains is the legacy field for backward compatibility
// If Domain is not set, the first domain in Domains is treated as primary
// Deprecated: Use Domain + RedirectFrom instead for clearer configuration
Domains []string `yaml:"domains,omitempty" json:"domains,omitempty"`
Email string `yaml:"email,omitempty" json:"email,omitempty"` // Email for Let's Encrypt
TLS TLSConfig `yaml:"tls,omitempty" json:"tls,omitempty"`
}
ProxyConfig defines per-service Traefik reverse proxy settings
func (*ProxyConfig) GetAllDomains ¶ added in v0.0.3
func (p *ProxyConfig) GetAllDomains() []string
GetAllDomains returns all domains (primary + additional domains from Domains array) excluding redirect domains
func (*ProxyConfig) GetPrimaryDomain ¶ added in v0.0.3
func (p *ProxyConfig) GetPrimaryDomain() string
GetPrimaryDomain returns the primary domain for this service
func (*ProxyConfig) GetRedirectDomains ¶ added in v0.0.3
func (p *ProxyConfig) GetRedirectDomains() []string
GetRedirectDomains returns all domains that should redirect to the primary domain
func (*ProxyConfig) HasRedirects ¶ added in v0.0.3
func (p *ProxyConfig) HasRedirects() bool
HasRedirects returns true if there are redirect domains configured
type SecretConfig ¶
type SecretConfig struct {
Name string `yaml:"name" json:"name"` // Secret name (e.g., "db_password")
Source string `yaml:"source,omitempty" json:"source,omitempty"` // Source: "env:VAR" or "file:path" (default: env:NAME)
Target string `yaml:"target,omitempty" json:"target,omitempty"` // Target path in container (default: /run/secrets/{name})
}
SecretConfig defines a Docker secret
type ServerConfig ¶
type ServerConfig struct {
Host string `yaml:"host" json:"host"`
User string `yaml:"user" json:"user"`
Port int `yaml:"port,omitempty" json:"port,omitempty"`
SSHKey string `yaml:"sshKey,omitempty" json:"sshKey,omitempty"` // Path to SSH private key (mutually exclusive with password)
Password string `yaml:"password,omitempty" json:"password,omitempty"` // SSH password (mutually exclusive with sshKey, use env var for security)
Role string `yaml:"role,omitempty" json:"role,omitempty"` // "manager" or "worker" (auto-detect if not specified)
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"` // Custom labels for server selection
}
ServerConfig defines server connection details
type ServerSelector ¶
type ServerSelector struct {
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"` // Match servers with these labels
Any bool `yaml:"any,omitempty" json:"any,omitempty"` // Select any available server
}
ServerSelector defines label-based server selection
type ServiceConfig ¶
type ServiceConfig struct {
// Build or Image (mutually exclusive)
Build string `yaml:"build,omitempty" json:"build,omitempty"` // Path to build context (auto-detects Dockerfile)
Image string `yaml:"image,omitempty" json:"image,omitempty"` // Pre-built image (for postgres, redis, etc)
// Basic settings
Port int `yaml:"port,omitempty" json:"port,omitempty"`
Command string `yaml:"command,omitempty" json:"command,omitempty"`
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"` // Default: 1
Restart string `yaml:"restart,omitempty" json:"restart,omitempty"` // Docker restart policy (always, unless-stopped, on-failure, no)
Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
EnvFile string `yaml:"envFile,omitempty" json:"envFile,omitempty"` // Path to .env file (e.g., .env.production)
// Secrets: Can be either string array (new Tako secrets) or SecretConfig array (Docker Swarm secrets)
// String format: ["DATABASE_URL", "JWT_SECRET"] or ["VAR_NAME:SECRET_KEY"]
// SecretConfig format: [{name: "db_pass", source: "env:DB_PASSWORD"}]
Secrets []string `yaml:"secrets,omitempty" json:"secrets,omitempty"` // Tako secrets from .tako/secrets files
DockerSecrets []SecretConfig `yaml:"dockerSecrets,omitempty" json:"dockerSecrets,omitempty"` // Docker Swarm secrets (for backward compatibility)
Volumes []string `yaml:"volumes,omitempty" json:"volumes,omitempty"`
// Service type flags
Persistent bool `yaml:"persistent,omitempty" json:"persistent,omitempty"` // Don't remove on redeploy (databases, caches)
// Per-service proxy settings (if present, service is exposed publicly)
Proxy *ProxyConfig `yaml:"proxy,omitempty" json:"proxy,omitempty"`
// Load balancing (for multi-replica services)
LoadBalancer LoadBalancerConfig `yaml:"loadBalancer,omitempty" json:"loadBalancer,omitempty"`
// Health checks
HealthCheck HealthCheckConfig `yaml:"healthCheck,omitempty" json:"healthCheck,omitempty"`
// Deployment strategy
Deploy DeployConfig `yaml:"deploy,omitempty" json:"deploy,omitempty"`
// Per-service hooks
Hooks *HooksConfig `yaml:"hooks,omitempty" json:"hooks,omitempty"`
// Per-service backup
Backup *BackupConfig `yaml:"backup,omitempty" json:"backup,omitempty"`
// Per-service monitoring
Monitoring *MonitoringConfig `yaml:"monitoring,omitempty" json:"monitoring,omitempty"`
// Cross-project networking
Export bool `yaml:"export,omitempty" json:"export,omitempty"` // Export this service to other projects
Imports []string `yaml:"imports,omitempty" json:"imports,omitempty"` // Import services from other projects (format: "project.service")
// Placement configuration (for Swarm multi-server deployments)
Placement *PlacementConfig `yaml:"placement,omitempty" json:"placement,omitempty"` // Where to run service replicas
// Service dependencies (controls deployment order)
DependsOn []string `yaml:"dependsOn,omitempty" json:"dependsOn,omitempty"` // List of service names this service depends on
// Init commands (run before service starts, useful for permissions)
Init []string `yaml:"init,omitempty" json:"init,omitempty"` // Commands to run before service starts (e.g., chown, chmod)
}
ServiceConfig defines service deployment settings
func (*ServiceConfig) GetServiceType ¶
func (s *ServiceConfig) GetServiceType() string
GetServiceType returns the auto-detected service type
func (*ServiceConfig) IsInternal ¶
func (s *ServiceConfig) IsInternal() bool
IsInternal returns true if service is internal-only
func (*ServiceConfig) IsPublic ¶
func (s *ServiceConfig) IsPublic() bool
IsPublic returns true if service should be exposed publicly
func (*ServiceConfig) IsWorker ¶
func (s *ServiceConfig) IsWorker() bool
IsWorker returns true if service is a background worker
type StorageConfig ¶ added in v0.1.2
type StorageConfig struct {
NFS *NFSConfig `yaml:"nfs,omitempty" json:"nfs,omitempty"`
}
StorageConfig defines shared storage configuration
type TLSConfig ¶
type TLSConfig struct {
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"` // letsencrypt, zerossl (default: letsencrypt)
Staging bool `yaml:"staging,omitempty" json:"staging,omitempty"`
}
TLSConfig defines TLS settings
type VolumeConfig ¶ added in v0.1.3
type VolumeConfig struct {
Driver string `yaml:"driver,omitempty" json:"driver,omitempty"` // Volume driver (default: "local")
DriverOpts map[string]string `yaml:"driver_opts,omitempty" json:"driver_opts,omitempty"` // Driver-specific options
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"` // Volume labels
External bool `yaml:"external,omitempty" json:"external,omitempty"` // If true, volume must already exist
Name string `yaml:"name,omitempty" json:"name,omitempty"` // Override the auto-generated name (opt-out of prefix)
}
VolumeConfig defines a named volume configuration (Docker Compose style)