Documentation
¶
Index ¶
Constants ¶
const LogTimestampLayout = "2006-01-02T15-04-05"
LogTimestampLayout is shared so a log filename can be parsed back into its time with the exact layout used to format it.
Variables ¶
This section is empty.
Functions ¶
func InFlight ¶
InFlight reports whether a Run holds the Job's lock and, while the agent is streaming, the name of the log file it is writing to. The name is empty during an earlier Condition check, before the agent's log exists.
func IsRunning ¶
IsRunning reports whether a Run currently holds the Job's lock. It is a best-effort, non-destructive probe of the same flock acquireLock takes: a successful try-lock (released at once) means no Run is in flight, EWOULDBLOCK means one is. The result is advisory; a firing can still begin the instant after it returns. It opens without O_CREATE so probing a Job that has never run reports false rather than littering a lock file.
func RunningSince ¶
RunningSince reports whether a Run is in flight for the Job and, when known, when it started. The start time is parsed from the in-flight Run's log file name; it is unknown (zero) during an earlier Condition check, before the agent's log exists. The name is stamped from a local time.Now(), so it parses back in time.Local to recover the true instant (not just the right digits).
Types ¶
type Reason ¶
type Reason string
Reason qualifies a Run's status when the agent did not produce it: the firing was dropped (ReasonOverlap, or ReasonCondition for a clean skip), or the condition check itself broke or was interrupted (ReasonCondition with StatusFailure or StatusInterrupted). ReasonNone is the zero value, used when the agent ran — whether it produced the status or an interrupt aborted it.
type Record ¶
type Result ¶
type Result struct {
Status Status
Reason Reason
Exit int
Duration time.Duration
LogPath string
Command []string // resolved agent argv, nil when the agent never ran
}