artifactsource

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 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 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

View Source
var ErrNotRegular = errors.New("not a regular file")

ErrNotRegular is returned for a directory, FIFO, device, or socket.

Functions

func Read

func Read(path string) ([]byte, error)

Read returns the contents of the regular file at path, or an error when it is not a regular file or is larger than artifact.MaxSourceBytes.

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 NewCache

func NewCache() *Cache

NewCache returns an empty Cache.

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.

func (*Cache) Script

func (cache *Cache) Script(path string) ([]byte, error)

Script returns the contents of the shell script at path, reading it only when this version has not been read before. Shell source is parsed again for each attempt, because PATH-E1 expands it with the attempt's values. It is an artifact.SourceReader.

Jump to

Keyboard shortcuts

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