Documentation
¶
Overview ¶
Package artifactsource reads the configuration files that artifact discovery inspects. It is the only file access discovery performs: it reads regular files only, never blocks on a FIFO or device, and bounds how much it reads. Symbolic links are followed, because configuration files are often linked; the target must be a regular file. Reading runs as the job's own user, and discovery records only the path references it classifies, never the contents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotRegular = errors.New("not a regular file")
ErrNotRegular is returned for a directory, FIFO, device, or socket.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache parses each configuration file once per version for one run, so the tasks of an array, the members of a matrix, and retries that name the same file share one parse. A version is the file's path, size, and modification time; a file that changes during the run is parsed again. Parse results are cached with their errors. Read errors are not, since the stat that finds them is cheap. A Cache is safe for concurrent use.
func (*Cache) References ¶
func (cache *Cache) References(path string) ([]artifact.ConfigReference, error)
References returns the references in the configuration file at path, parsing it only when this version has not been parsed before. A file that is not regular or is larger than artifact.MaxSourceBytes is rejected from its stat, without being read. It is an artifact.ConfigReader.