Documentation
¶
Overview ¶
Package deploy reads a workly.yaml, which declares queues 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" 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 or api.ScheduleConfig.
Body any
}
Change is what deploying does to one declared queue 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 ¶
File is a valid workly.yaml. A section left out of the file isn't managed by it (HasQueues, 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 and then every declared schedule, in
// file order, unchanged ones included.
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
}
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
}