Documentation
¶
Overview ¶
Package pointer holds the parts of the pointers to spec sources that do not depend on the agent (spec issue-3556).
A spec source is a file of the spec folder that the push stores as its own material. A session transcript can hold the same content again, for example in a full read of the file or in the write that created it. Each agent that can find these copies replaces each one, at its position, with a pointer that holds the digest of the material. Only exact copies are replaced: the digest of the content must be equal to the digest of a source.
Index ¶
Constants ¶
const ( FinderFileRead = "file_read" FinderFileWrite = "file_write" // FinderPastedImage finds the images that the user pasted into the // session (spec issue-3569). FinderPastedImage = "pasted_image" )
The finders, as the match report names them.
const ( ReasonNoSpecEntry = "no spec entry with this digest" ReasonFileGone = "file gone" ReasonFileChanged = "file changed" ReasonPartialRead = "partial read" ReasonToolError = "tool error" ReasonUnsupported = "unsupported result" // ReasonInvalidImage is a pasted image whose data cannot be decoded. ReasonInvalidImage = "invalid image data" // ReasonMaterialNotStored is a pasted image that the push could not // store as a material. ReasonMaterialNotStored = "material not stored" )
Reasons for a copy that stays inline, as the match report gives them.
const Marker = "chainloop.replaced"
Marker is the type of a pointer, and the name of the field that holds a pointer in place of a text field. It tells any reader that Chainloop replaced the content.
Variables ¶
This section is empty.
Functions ¶
func DigestReader ¶
DigestReader returns the digest of what r holds, in the form that Sources uses, with no copy of it in memory.
func New ¶
func New(digest string) json.RawMessage
New returns the pointer to the material with the given digest.
Types ¶
type Result ¶
type Result struct {
// Replaced is the number of copies replaced with a pointer.
Replaced int
// Skipped counts, per reason, the copies that stay inline.
Skipped map[string]int
// BytesRemoved is the size of the replaced content.
BytesRemoved int
}
Result counts the copies one finder looked at.