Documentation
¶
Index ¶
Constants ¶
View Source
const ( // BlobAlgorithm is the name of the only supported digest algorithm for blobs. // FIXME: We can make this a list. BlobAlgorithm = "sha256" )
View Source
const ImageLayoutVersion = "1.0.0"
ImageLayoutVersion is the version of the image layout we support. This value is *not* the same as imagespec.Version, and the meaning of this field is still under discussion in the spec. For now we'll just hardcode the value and hope for the best.
Variables ¶
View Source
var ( // ErrInvalid is returned when an image was detected as being invalid. ErrInvalid = errors.New("invalid image detected") // ErrNotImplemented is returned when a requested operation has not been // implementing the backing image store. ErrNotImplemented = errors.New("operation not implemented") // ErrClobber is returned when a requested operation would require clobbering a // reference or blob which already exists. ErrClobber = errors.New("operation would clobber existing object") )
Exposed errors.
Functions ¶
This section is empty.
Types ¶
type ImageLayout ¶
type ImageLayout struct {
Version string `json:"imageLayoutVersion"`
}
ImageLayout is the structure in the "oci-layout" file, found in the root of an OCI Image-layout directory. XXX: This comes from the spec, but hasn't been vendored.
type Layout ¶
type Layout interface { // PutBlob adds a new blob to the image. This is idempotent; a nil error // means that "the content is stored at DIGEST" without implying "because // of this PutBlob() call". PutBlob(ctx context.Context, reader io.Reader) (digest string, size int64, err error) // PutReference adds a new reference descriptor blob to the image. This is // idempotent; a nil error means that "the descriptor is stored at NAME" // without implying "because of this PutReference() call". ErrClobber is // returned if there is already a descriptor stored at NAME, but does not // match the descriptor requested to be stored. PutReference(ctx context.Context, name string, descriptor *v1.Descriptor) (err error) // GetBlob returns a reader for retrieving a blob from the image, which the // caller must Close(). Returns os.ErrNotExist if the digest is not found. GetBlob(ctx context.Context, digest string) (reader io.ReadCloser, err error) // Exist returns true if digest is exist, else return false, which he // caller must Close(). Exist(ctx context.Context, digest string) (exist bool, err error) // GetReference returns a reference from the image. Returns os.ErrNotExist // if the name was not found. GetReference(ctx context.Context, name string) (descriptor *v1.Descriptor, err error) // DeleteBlob removes a blob from the image. This is idempotent; a nil // error means "the content is not in the store" without implying "because // of this DeleteBlob() call". DeleteBlob(ctx context.Context, digest string) (err error) // DeleteReference removes a reference from the image. This is idempotent; // a nil error means "the content is not in the store" without implying // "because of this DeleteReference() call". DeleteReference(ctx context.Context, name string) (err error) // ListBlobs returns the set of blob digests stored in the image. ListBlobs(ctx context.Context) (digests []string, err error) // ListReferences returns the set of reference names stored in the image. ListReferences(ctx context.Context) (names []string, err error) // Close releases all references held by the engine. Subsequent operations // may fail. Close() (err error) // GetBlobPath returns a path of a blob from the image GetBlobPath(ctx context.Context, digest string) (path string, err error) }
Layout is an interface that provides methods for accessing and modifying an OCI image, namely allowing access to reference descriptors and blobs.
Click to show internal directories.
Click to hide internal directories.