identity

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 549

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 FromBytes

func FromBytes(p []byte) digest.Digest

FromBytes digests the input and returns a Digest.

func FromReader

func FromReader(rd io.Reader) (digest.Digest, error)

FromReader consumes the content of rd until io.EOF, returning canonical digest.

func FromString

func FromString(s string) digest.Digest

FromString digests the input and returns a Digest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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