config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0 modules, 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

Overview

Package config loads and validates a skiff.toml describing a single app.

Index

Constants

View Source
const DefaultFile = "skiff.toml"
View Source
const DefaultPort = 8080

DefaultPort is the port an app is assumed to listen on when nothing says otherwise.

View Source
const MaxVolumes = 5

Variables

This section is empty.

Functions

func RegistryHost added in v0.5.0

func RegistryHost(ref string) string

RegistryHost is the registry an image reference is pulled from; Docker Hub when the first part isn't a hostname.

func ValidateHealth added in v0.5.0

func ValidateHealth(path string, timeout int) error

ValidateHealth checks a health-check path and timeout (seconds, 0 for the default).

func ValidateImage added in v0.5.0

func ValidateImage(ref string) error

ValidateImage checks an image reference like nginx:1.27 or ghcr.io/you/api@sha256:… without contacting a registry.

func ValidateVolumes added in v0.5.0

func ValidateVolumes(vols []Volume) error

ValidateVolumes checks names and mount paths, so every deploy path accepts the same set.

func VolumeName added in v0.5.0

func VolumeName(app, name string) string

VolumeName is the docker volume backing an app's volume; app names never contain "_", so no two apps can share one.

Types

type Build added in v0.1.3

type Build struct {
	Dockerfile string `toml:"dockerfile"`
	Port       int    `toml:"port"`

	// Image, when set, deploys a prebuilt image instead of building; with no port set, the one the image exposes is used.
	Image string `toml:"image"`

	// Optional recipe overrides: setting start or static skips auto-detection and builds from these instead of a Dockerfile.
	Base    string `toml:"base"`
	Install string `toml:"install"`
	Build   string `toml:"build"`
	Start   string `toml:"start"`
	Static  string `toml:"static"`
}

type Config

type Config struct {
	Name     string `toml:"name"`
	Replicas int    `toml:"replicas"`

	Server    Server            `toml:"server"`
	Build     Build             `toml:"build"`
	Deploy    Deploy            `toml:"deploy"`
	Resources Resources         `toml:"resources"`
	Env       map[string]string `toml:"env"`
	Secrets   map[string]string `toml:"secrets"` // runtime only, never baked into the image
	Volumes   []Volume          `toml:"volumes"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) Environment

func (c *Config) Environment(dir string) map[string]string

func (*Config) IsLocal

func (c *Config) IsLocal() bool

func (*Config) RemoteHost

func (c *Config) RemoteHost() string

func (*Config) TargetLabel

func (c *Config) TargetLabel() string

type Deploy added in v0.1.3

type Deploy struct {
	Release       string `toml:"release"`
	Network       string `toml:"network"`
	HealthPath    string `toml:"health_path"`    // must answer 2xx/3xx before traffic moves; empty = any reply at /
	HealthTimeout int    `toml:"health_timeout"` // seconds; 0 = the default
}

type Resources added in v0.1.3

type Resources struct {
	Memory string `toml:"memory"`
	CPU    string `toml:"cpu"`
}

type Server added in v0.1.3

type Server struct {
	Host string `toml:"host"`
}

type Volume added in v0.5.0

type Volume struct {
	Name string `toml:"name" json:"name"`
	Path string `toml:"path" json:"path"`
}

Volume is a named directory that outlives the app's containers.

Jump to

Keyboard shortcuts

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