Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v0.112.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkerConfig

func GetWorkerConfig() *viper.Viper

GetWorkerConfig returns the current worker viper config instance. Returns nil if LoadWorkerConfig has not been called.

Types

type Trigger added in v0.75.2

type Trigger struct {
	// command to execute
	Command string `mapstructure:"command" json:"command"`

	// optional name (defaults to command)
	Name string `mapstructure:"name" json:"name,omitempty"`

	// optional description
	Description string `mapstructure:"description" json:"description,omitempty"`
}

type WorkerConfig

type WorkerConfig struct {
	Triggers []Trigger       `mapstructure:"triggers" json:"triggers,omitempty"`
	Dev      WorkerDevConfig `mapstructure:"dev" json:"dev,omitempty"`
}

func LoadWorkerConfig

func LoadWorkerConfig() (*WorkerConfig, error)

LoadWorkerConfig loads the worker configuration from a hatchet.yaml file in the current working directory. Returns nil config if the file doesn't exist.

type WorkerDevConfig

type WorkerDevConfig struct {
	// commands to run before starting the worker
	PreCmds []string `mapstructure:"preCmds" json:"preCmds,omitempty"`

	// command to run the worker
	RunCmd string `mapstructure:"runCmd" json:"runCmd,omitempty"`

	// list of glob files to watch for reloads
	Files []string `mapstructure:"files" json:"files,omitempty"`

	// whether to reload on file changes
	Reload bool `mapstructure:"reload" json:"reload,omitempty"`
}

Jump to

Keyboard shortcuts

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