chain

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 4 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 chain computes OCI layer chain IDs.

A chain ID identifies an ordered stack of uncompressed layers. The OCI image spec defines it recursively:

chain(1) = diff_id(1)
chain(n) = sha256(chain(n-1) + " " + diff_id(n))

Two images share a chain ID at depth n exactly when their first n layers are identical, which is what strata uses to infer parents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDs

func IDs(diffIDs []string) ([]string, error)

IDs returns the chain ID of every prefix of diffIDs, shortest first, so IDs(d)[len(d)-1] is the image's top chain ID. Every diff ID must be a well-formed sha256 digest.

func Top

func Top(diffIDs []string) (string, error)

Top returns the chain ID of the full stack, or "" for an image with no layers.

func Validate

func Validate(d string) error

Validate reports whether d is a lowercase sha256 digest in the form "sha256:<64 hex>".

Types

This section is empty.

Jump to

Keyboard shortcuts

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