props

package
v0.8.22 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package props declares the Dokku-style "<plugin>:set <app> <key> <value>" properties. Each plugin's keys live in the generic properties table, and the CLI generates "<plugin>:set" and "<plugin>:report" commands from this list, so adding a setting is one entry here.

Index

Constants

This section is empty.

Variables

View Source
var MinSleepAfter = 30 * time.Second

MinSleepAfter is the shortest sleep-after: proxies report requests every few seconds, so a shorter one could put an app to sleep while it's used. A variable so tests can shorten it.

View Source
var Plugins = []Plugin{
	{
		Name: "git", Help: "Manage app deploys via git", Settable: true,
		Keys: []Key{
			{Name: "deploy-branch", Default: "main", Help: "Branch that triggers a deploy when pushed"},
			{Name: "keep-git-dir", Default: "false", Help: "Keep the .git directory in the build context", Validate: isBool},
		},
	},
	{
		Name: "builder", Help: "Manage how an app is built", Settable: true,
		Keys: []Key{
			{Name: "type", Default: "dockerfile", Help: "dockerfile, compose or image", Validate: oneOf("dockerfile", "compose", "image"),
				SetBy: "jokku builder:dockerfile, builder:compose or builder:image"},
			{Name: "file", Help: "The Dockerfile or compose file, relative to the build dir; empty for the default",
				SetBy: "jokku builder:dockerfile <app> <path> or builder:compose <app> <path>"},
			{Name: "image", Help: "The registry image an image app runs", SetBy: "jokku builder:image"},
			{Name: "build-dir", Help: "Subdirectory of the repo to build from"},
			{Name: "procfile", Default: "Procfile", Help: "Path to the Procfile, relative to the build dir"},
		},
	},
	{
		Name: "checks", Help: "Manage zero-downtime deploy checks", Settable: true,
		Keys: []Key{
			{Name: "wait-to-retire", Default: "60", Help: "Seconds to keep old instances after a deploy", Validate: isNonNegativeInt},
			{Name: "timeout", Default: "120", Help: "Seconds new instances get to boot and pass checks", Validate: isNonNegativeInt},
		},
	},
	{
		Name: "ps", Help: "Manage app processes", Settable: true,
		Keys: []Key{
			{Name: "restart-policy", Default: "on-failure:10", Help: "always | no | on-failure[:N]", Validate: isRestartPolicy},
			{Name: "sleep-after", Help: "Stop the app's instances after this long without requests (15m, 1h); the next request starts them again",
				Validate: isSleepAfter},
		},
	},
	{
		Name: "proxy", Help: "Manage the HTTP proxy for an app", Settable: true,
		Keys: []Key{
			{Name: "enabled", Default: "true", Help: "Route HTTP traffic to the app", Validate: isBool},
			{Name: "compress", Default: "true", Help: "Compress the text responses the app doesn't compress itself", Validate: isBool},
		},
	},
	{
		Name: "letsencrypt", Help: "Manage automatic TLS certificates", Settable: true,
		Keys: []Key{
			{Name: "email", Default: "", Help: "ACME account email (usually set with --global)"},

			{Name: "enabled", Default: "true", Help: "Request certificates for the app's domains", Validate: isBool},
		},
	},
}

Functions

func Check

func Check(plugin, key, value string) error

Check validates a value for plugin/key. An empty value (unset) is always valid.

func Compute

func Compute(p Plugin, app, global map[string]string) map[string]string

Compute resolves a key: the app value wins, then the global value, then the default.

func SleepAfter

func SleepAfter(v string) time.Duration

SleepAfter reads a computed sleep-after: 0 for never.

Types

type Key

type Key struct {
	Name     string
	Default  string
	Help     string
	Validate func(string) error
	// SetBy names the commands that change this key, for keys "<plugin>:set"
	// doesn't take. They are per app only: they have no global value.
	SetBy string
}

type Plugin

type Plugin struct {
	Name string
	Help string
	Keys []Key
	// Settable plugins get "<plugin>:set"; keys that commands of their own
	// change say so in SetBy.
	Settable bool
}

func Lookup

func Lookup(plugin string) (Plugin, bool)

func (Plugin) Key

func (p Plugin) Key(name string) (Key, bool)

func (Plugin) SetKeys

func (p Plugin) SetKeys() []string

SetKeys lists the keys "<plugin>:set" takes.

Jump to

Keyboard shortcuts

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