layout

package
v0.0.0-...-70a5abf Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectNil            = fmt.Errorf("object is nil")
	ErrUnsupportedMediaType = fmt.Errorf("unsupported Medatype")
)

Some common errors

Functions

This section is empty.

Types

type Config

type Config struct {
	Layout      *Layout   // the layout that references this image config
	Ref         string    // the reference name that references this image config
	Manifest    *Manifest // the manifest that references this image config
	ImageConfig *v1.Image // the actual OCI image config
}

Config carries the layout and ref name, plus the full structure for the OCI image manifest

func (Config) ChainID

func (c Config) ChainID() (*DigestRef, error)

ChainID is the calculated identification of the culmination of an OCI image config's diff_ids. See https://github.com/opencontainers/image-spec/blob/master/config.md#layer-chainid

type DigestRef

type DigestRef struct {
	Name   string
	Layout *Layout
}

DigestRef for name to digest mapping and validating the blob at the address is actually the expected size.

func (DigestRef) Calculate

func (d DigestRef) Calculate() (string, error)

Calculate the checksum of the backing blob for this digest, with the prescribed hash.

func (DigestRef) HashName

func (d DigestRef) HashName() string

HashName provides just the hash name portion of the digest string (e.g. "sha256:ed2dca..." -> "sha256")

func (DigestRef) IsValid

func (d DigestRef) IsValid() (bool, error)

IsValid returns whether the backing blob checksum is the same as the referenced digest.

func (DigestRef) Sum

func (d DigestRef) Sum() string

Sum provides the hexadecimal portion of the digest string

type Layout

type Layout struct {
	Root string
	Name string
}

Layout is an OCI image layout that includes descriptor refs and the content addressible objects pointed to by the descriptors.

func (*Layout) Blobs

func (l *Layout) Blobs() ([]DigestRef, error)

Blobs gives the path to all regular files or symlinks in this layout's "blobs" directory

func (Layout) GetBlob

func (l Layout) GetBlob(digest DigestRef) (io.ReadCloser, error)

GetBlob returns the stream for a blob addressed by it's digest (`sha256:abcde123456...`)

func (Layout) GetRef

func (l Layout) GetRef(name string) (*v1.Descriptor, error)

GetRef loads the descriptor reference for this OCI image

func (Layout) OCIVersion

func (l Layout) OCIVersion() (string, error)

OCIVersion reads the OCI image layout version for this layout

func (Layout) Refs

func (l Layout) Refs() ([]string, error)

Refs gives the path to all regular files or symlinks in this layout's "refs" directory

type Layouts

type Layouts map[string]*Layout

Layouts is a collections OCI image layouts

func WalkForLayouts

func WalkForLayouts(rootpath string) (layouts Layouts, err error)

WalkForLayouts looks through rootpath for OCI image-layout directories. Namely a directory that has "refs" and "blobs" directory, and an oci-layout file.

type Manifest

type Manifest struct {
	Layout   *Layout
	Ref      string
	Manifest *v1.Manifest
}

Manifest carries the layout and ref name, plus the full structure for the OCI image manifest

func ManifestFromDescriptor

func ManifestFromDescriptor(l *Layout, d *v1.Descriptor) (*Manifest, error)

ManifestFromDescriptor simplifies the reaching of manifest as the descriptors are accessed

func (*Manifest) Config

func (m *Manifest) Config() (*Config, error)

Config provides the structure for this particular view of this layout reference of the config

func (Manifest) ConfigReader

func (m Manifest) ConfigReader() (io.ReadCloser, error)

ConfigReader gives access to the raw body of the config for this manifest. The caller is responsible to close the io.ReadCloser

Jump to

Keyboard shortcuts

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