jobs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jobs exclusively owns job definitions and their files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAvailable

func CheckAvailable(dir, name string) error

CheckAvailable rejects both an exact collision and a case variant before a dry run or a real create, consistently on case-sensitive and insensitive disks.

func Create

func Create(dir string, j Job) error

Create publishes a complete definition only if its name does not already exist.

func Encode

func Encode(j Job) (string, error)

func Exists

func Exists(dir, name string) (bool, error)

func ReadPrompt

func ReadPrompt(dir string, j Job) (string, error)

func Remove

func Remove(dir, name string) error

func ValidateName

func ValidateName(name string) error

func Write

func Write(dir string, j Job) error

Write uses a same-directory temporary file; readers only see complete definitions.

Types

type Entry

type Entry struct {
	Name  string `json:"name"`
	Job   *Job   `json:"job,omitempty"`
	Error string `json:"error,omitempty"`
}

func List

func List(dir string) ([]Entry, error)

type Job

type Job struct {
	Name       string   `toml:"-" json:"name"`
	Schedule   string   `toml:"schedule" json:"schedule"`
	Timezone   string   `toml:"timezone" json:"timezone"`
	Runner     string   `toml:"runner" json:"runner"`
	Prompt     string   `toml:"prompt,omitempty" json:"prompt,omitempty"`
	PromptFile string   `toml:"prompt_file,omitempty" json:"prompt_file,omitempty"`
	Repo       string   `toml:"repo,omitempty" json:"repo,omitempty"`
	Base       string   `toml:"base,omitempty" json:"base,omitempty"`
	Args       []string `toml:"args,omitempty" json:"args"`
	Command    []string `toml:"command,omitempty" json:"command,omitempty"`
	Timeout    string   `toml:"timeout" json:"timeout"`
	Expect     string   `toml:"expect,omitempty" json:"expect,omitempty"`
	Memory     bool     `toml:"memory" json:"memory"`
	Catchup    string   `toml:"catchup" json:"catchup"`
	CreatedBy  string   `toml:"created_by" json:"created_by"`
}

func Defaults

func Defaults(name string) Job

func Parse

func Parse(dir, name string, data []byte) (Job, error)

func Read

func Read(dir, name string) (Job, error)

func ReadForRun

func ReadForRun(dir, name string) (Job, error)

ReadForRun defers prompt-file availability checks to preflight, so failures receive a blocked_config ledger row rather than disappearing as usage errors.

func (*Job) Validate

func (j *Job) Validate(dir string) error

Jump to

Keyboard shortcuts

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