Documentation
¶
Overview ¶
Package deploy reads a workly.yaml, which declares queues, workflows and schedules, and works out the changes that make a server match it. The CLI's validate, plan and deploy commands are built on it.
Index ¶
Constants ¶
const Version = 1
Version is the file format version this package reads.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Kind string // "queue", "workflow" or "schedule"
Name string
Action Action
// Diffs lists the settings an update changes.
Diffs []Diff
// Paused is set for an existing queue or schedule that is paused.
// Deploying leaves it paused.
Paused bool
// Body is the PUT request body: an api.QueueConfig, api.WorkflowConfig
// or api.ScheduleConfig.
Body any
}
Change is what deploying does to one declared queue, workflow or schedule.
type Diff ¶
Diff is one changed setting. Change reads "old → new", or for header values and bodies, which may hold secrets, just "changed", "added" or "removed".
type File ¶
type File struct {
Path string
Queues []Queue
Workflows []Workflow
Schedules []Schedule
HasQueues, HasWorkflows, HasSchedules bool
}
File is a valid workly.yaml. A section left out of the file isn't managed by it (HasQueues, HasWorkflows, HasSchedules); an empty one declares nothing.
func Load ¶
Load reads and validates the file at path, replacing ${NAME} in values with environment variables looked up by getenv (os.LookupEnv in the CLI).
type InvalidError ¶
InvalidError lists every problem found in a file.
func (*InvalidError) Error ¶
func (e *InvalidError) Error() string
type Plan ¶
type Plan struct {
// Changes has every declared queue, then every declared workflow, then
// every declared schedule, in file order, unchanged ones included. That
// is the order they are applied in, so a schedule's workflow exists by
// the time the schedule is put.
Changes []Change
// Undeclared lists the schedules on the server the file doesn't
// declare, if it has a schedules section. Deploying leaves them alone.
// Queues aren't listed: enqueueing creates them, so most aren't in a
// file.
Undeclared []string
// UndeclaredWorkflows does the same for workflows.
UndeclaredWorkflows []string
}
type Problem ¶
Problem is one thing wrong with a file: where, which field (a path such as schedules.nightly.cron) and what.
type Queue ¶
type Queue struct {
Name string
Config api.QueueConfig
// contains filtered or unexported fields
}
Queue is a declared queue: Config is the PUT body, settings what it becomes with defaults applied.
type Schedule ¶
type Schedule struct {
Name string
Config api.ScheduleConfig
// contains filtered or unexported fields
}
type Workflow ¶ added in v0.4.0
type Workflow struct {
Name string
Config api.WorkflowConfig
// contains filtered or unexported fields
}