config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRestartDelay = 500 * time.Millisecond
View Source
const DefaultShutdownTimeout = 500 * time.Millisecond
View Source
const DefaultWatchDebounce = 500 * time.Millisecond

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project   Project         `toml:"project"`
	Processes []ProcessConfig `toml:"process"`
}

func Load

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

type ProcessConfig

type ProcessConfig struct {
	Name            string            `toml:"name"`
	Cmd             string            `toml:"cmd"`
	Cwd             string            `toml:"cwd"`
	Port            int               `toml:"port"`
	PortEnv         string            `toml:"port_env"`
	NoPort          bool              `toml:"no_port"`
	DependsOn       []string          `toml:"depends_on"`
	Env             map[string]string `toml:"env"`
	RestartDelay    string            `toml:"restart_delay"`
	ShutdownTimeout string            `toml:"shutdown_timeout"`
	// File watching + auto-restart (opt-in)
	Watch         []string `toml:"watch"`          // directories to watch for changes
	WatchInclude  []string `toml:"watch_include"`  // file glob patterns to react to, e.g. ["*.go"]
	WatchExclude  []string `toml:"watch_exclude"`  // directories to exclude from watching, e.g. ["tmp","vendor"]
	Build         []string `toml:"build"`          // optional: ordered build steps chained in one shell invocation before restarting, e.g. ["go generate ./...", "go build ./..."]
	WatchDebounce string   `toml:"watch_debounce"` // debounce delay, default "500ms"
}

func (ProcessConfig) RestartDelayDuration

func (p ProcessConfig) RestartDelayDuration() time.Duration

RestartDelayDuration parses and returns the process restart delay.

func (ProcessConfig) ShutdownTimeoutDuration

func (p ProcessConfig) ShutdownTimeoutDuration() time.Duration

ShutdownTimeoutDuration parses and returns the graceful shutdown timeout.

func (ProcessConfig) WatchDebounceDuration added in v1.4.0

func (p ProcessConfig) WatchDebounceDuration() time.Duration

WatchDebounceDuration parses and returns the watch debounce delay.

type Project

type Project struct {
	Name    string `toml:"name"`
	APIAddr string `toml:"api_addr"`
	Shell   string `toml:"shell"` // "auto" (default), "cmd", "bash", or "pwsh"
}

Jump to

Keyboard shortcuts

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