Documentation ¶
Overview ¶
Package identity provides implementations of subtle calculations pertaining to image and layer identity. The primary item present here is the ChainID calculation used in identifying the result of subsequent layer applications.
Helpers are also provided here to ease transition to the github.com/opencontainers/go-digest package, but that package may be used directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainID ¶
func ChainID(dgsts []digest.Digest) digest.Digest
ChainID takes a slice of digests and returns the ChainID corresponding to the last entry. Typically, these are a list of layer DiffIDs, with the result providing the ChainID identifying the result of sequential application of the preceding layers.
func ChainIDs ¶
func ChainIDs(dgsts []digest.Digest) []digest.Digest
ChainIDs calculates the recursively applied chain id for each identifier in the slice. The result is written direcly back into the slice such that the ChainID for each item will be in the respective position.
By definition of ChainID, the zeroth element will always be the same before and after the call.
As an example, given the chain of ids `[A, B, C]`, the result `[A, ChainID(A|B), ChainID(A|B|C)]` will be written back to the slice.
The input is provided as a return value for convenience.
Typically, these are a list of layer DiffIDs, with the result providing the ChainID for each the result of each layer application sequentially.
func FromReader ¶
FromReader consumes the content of rd until io.EOF, returning canonical digest.
func FromString ¶
FromString digests the input and returns a Digest.
Types ¶
This section is empty.