Documentation
¶
Overview ¶
Package config loads and validates a skiff.toml describing a single app.
Index ¶
- Constants
- func RegistryHost(ref string) string
- func ValidateHealth(path string, timeout int) error
- func ValidateHost(h string) error
- func ValidateImage(ref string) error
- func ValidateResources(memory, cpu string) error
- func ValidateVolumes(vols []Volume) error
- func VolumeName(app, name string) string
- type Build
- type Config
- type Deploy
- type Resources
- type Server
- type Volume
Constants ¶
const DefaultFile = "skiff.toml"
const DefaultPort = 8080
DefaultPort is the port an app is assumed to listen on when nothing says otherwise.
const MaxVolumes = 5
Variables ¶
This section is empty.
Functions ¶
func RegistryHost ¶ added in v0.5.0
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
ValidateHealth checks a health-check path and timeout (seconds, 0 for the default).
func ValidateHost ¶ added in v0.5.4
ValidateHost accepts [user@]host[:port] and nothing ssh or docker could read as an option or a different URL.
func ValidateImage ¶ added in v0.5.0
ValidateImage checks an image reference like nginx:1.27 or ghcr.io/you/api@sha256:… without contacting a registry.
func ValidateResources ¶ added in v0.5.1
ValidateResources checks a replica's memory and CPU limits; empty means no limit of its own.
func ValidateVolumes ¶ added in v0.5.0
ValidateVolumes checks names and mount paths, so every deploy path accepts the same set.
func VolumeName ¶ added in v0.5.0
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"`
}