worker

package
v0.75.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 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 {
	Dev      WorkerDevConfig `mapstructure:"dev" json:"dev,omitempty"`
	Triggers []Trigger       `mapstructure:"triggers" json:"triggers,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