Documentation
¶
Overview ¶
Package file is the file action: it looks at what is at a path, and reads it when it is a regular file, so that a step can check a log, a file written by what is tested, or that a file has come or gone. It writes, appends to or deletes a file as well, so that a workflow can make what it tests with and remove it, which it refuses under a read-only guard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGuarded ¶
RunGuarded does what op of with asks for at the path with gives, and returns the step's result: what is at the path afterwards, as read gives it. read, the default, only looks; write, append and delete change what is at the path, and are refused under a read-only guard before they do.
Nothing at the path is a result for the step's test to check, with res.exists false and status 1, so that a step can wait with retry for a file to come or to go. What is there is read only when it is a regular file; a path that cannot be looked at or read is an error.
func Spec ¶
func Spec() actionspec.Spec
Spec declares the file action. It keeps to every kind of guard: it only reads under read-only, refusing write, append and delete, and connects to nothing. It cannot run without path.