config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGroup

func LoadGroup(group string) (map[string]TaskDef, error)

LoadGroup resolves a group from the config file, validating it exists and every task has a command.

Types

type Config

type Config map[string]map[string]TaskDef

func Load

func Load() (Config, string, error)

type TaskDef

type TaskDef struct {
	Command       string   `yaml:"command"`
	Before        string   `yaml:"before"`
	After         string   `yaml:"after"`
	OnSuccess     string   `yaml:"on_success"`
	OnError       string   `yaml:"on_error"`
	OnTimeout     string   `yaml:"on_timeout"`
	Timeout       int      `yaml:"timeout"` // milliseconds, 0 = none
	RestartPolicy string   `yaml:"restart_policy"`
	KeepShell     bool     `yaml:"keep_shell"`
	Triggers      string   `yaml:"triggers"`   // "auto" (default) | "manual"
	DependsOn     []string `yaml:"depends_on"` // tasks that must succeed first
	Group         string   `yaml:"group"`      // sidebar grouping, collapsible
}

TaskDef is one task in a group. In yaml it is either a plain string (the command) or an object with lifecycle fields:

dev:
  ui: cd discover && pnpm dev
  api:
    command: go run ./cmd
    before: echo starting
    timeout: 10000            # ms
    on_timeout: echo timed out
    on_error: echo failed
    on_success: echo ok
    after: echo done
    restart_policy: always    # always | on-failure | never
    keep_shell: true          # drop into an interactive shell after

func (*TaskDef) UnmarshalYAML

func (t *TaskDef) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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