Documentation ¶
Index ¶
- Variables
- func AuthConfig(username, password string) remote.Option
- func CompatibleManifest(mt types.MediaType) bool
- func GetLayer(manifest *v1.Manifest, mediaType types.MediaType) (v1.Descriptor, error)
- func GetLayerFilter(manifest *v1.Manifest, mediaTypeFilter MediaTypeFilter) (v1.Descriptor, error)
- func GetManifest(ref name.Reference, options ...remote.Option) (*v1.Manifest, error)
- func HeadManifest(ref name.Reference, options ...remote.Option) (types.MediaType, string, error)
- func Pull(puller Puller, options ...remote.Option) error
- func PullIndex(puller Puller, options ...remote.Option) error
- func Push(pusher Pusher, options ...remote.Option) error
- type Image
- func (i *Image) AddConfig(mt types.MediaType, rawConfig []byte) error
- func (i *Image) AddLayer(layer Layer) error
- func (i *Image) ConfigFile() (*v1.ConfigFile, error)
- func (i *Image) ConfigName() (v1.Hash, error)
- func (i *Image) Digest() (v1.Hash, error)
- func (i *Image) LayerByDiffID(v1.Hash) (v1.Layer, error)
- func (i *Image) LayerByDigest(hash v1.Hash) (v1.Layer, error)
- func (i *Image) Layers() ([]v1.Layer, error)
- func (i *Image) Manifest() (*v1.Manifest, error)
- func (i *Image) MediaType() (types.MediaType, error)
- func (i *Image) RawConfigFile() ([]byte, error)
- func (i *Image) RawManifest() ([]byte, error)
- func (i *Image) Size() (int64, error)
- type ImageIndex
- func (i *ImageIndex) AddImage(image *Image) error
- func (i *ImageIndex) Digest() (v1.Hash, error)
- func (i *ImageIndex) Image(hash v1.Hash) (v1.Image, error)
- func (i *ImageIndex) ImageIndex(v1.Hash) (v1.ImageIndex, error)
- func (i *ImageIndex) IndexManifest() (*v1.IndexManifest, error)
- func (i *ImageIndex) MediaType() (types.MediaType, error)
- func (i *ImageIndex) RawManifest() ([]byte, error)
- func (i *ImageIndex) RemoveImage(hash v1.Hash)
- func (i *ImageIndex) Size() (int64, error)
- type Layer
- type MediaTypeFilter
- type Puller
- type Pusher
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoImageIndexToPush = errors.New("no image index to push") ErrNoImageToPush = errors.New("no image to push") )
Functions ¶
func AuthConfig ¶
AuthConfig returns option for the authentication to a remote registry.
func CompatibleManifest ¶
CompatibleManifest returns if the media type corresponds to a compatible ORAS manifest.
func GetLayerFilter ¶ added in v0.0.6
func GetLayerFilter(manifest *v1.Manifest, mediaTypeFilter MediaTypeFilter) (v1.Descriptor, error)
func GetManifest ¶
GetManifest returns the manifest corresponding to the reference.
func HeadManifest ¶
HeadManifest returns the media type and digest of the manifest corresponding to the reference.
Types ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image defines an ORAS artifact manifest with the associated images layers.
func NewImage ¶
func NewImage() *Image
NewImage returns a Image instance for uploading SIF images to OCI registries.
func (*Image) ConfigFile ¶
func (i *Image) ConfigFile() (*v1.ConfigFile, error)
ConfigFile returns this image's config file.
func (*Image) ConfigName ¶
ConfigName returns the hash of the image's config file, also known as the Image ID.
func (*Image) LayerByDiffID ¶
LayerByDiffID is an analog to LayerByDigest, looking up by "diff id" (not supported by ORAS).
func (*Image) LayerByDigest ¶
LayerByDigest returns a Layer for interacting with a particular layer of the image, looking it up by "digest" (the compressed hash).
func (*Image) RawConfigFile ¶
RawConfigFile returns the serialized bytes of ConfigFile().
func (*Image) RawManifest ¶
RawManifest returns the serialized bytes of Manifest().
type ImageIndex ¶
type ImageIndex struct {
// contains filtered or unexported fields
}
ImageIndex defines an image index.
func ImageIndexFromReference ¶
ImageIndexIndexFromReference returns an image index populated with the remote image reference to update an existing image index.
func (*ImageIndex) AddImage ¶
func (i *ImageIndex) AddImage(image *Image) error
AddImage adds an image to the image index.
func (*ImageIndex) Digest ¶
func (i *ImageIndex) Digest() (v1.Hash, error)
Digest returns the sha256 of this index's manifest.
func (*ImageIndex) ImageIndex ¶
func (i *ImageIndex) ImageIndex(v1.Hash) (v1.ImageIndex, error)
ImageIndex returns a v1.ImageIndex that this ImageIndex references. Not supported for ORAS.
func (*ImageIndex) IndexManifest ¶
func (i *ImageIndex) IndexManifest() (*v1.IndexManifest, error)
IndexManifest returns this image index's manifest object.
func (*ImageIndex) MediaType ¶
func (i *ImageIndex) MediaType() (types.MediaType, error)
MediaType of this image's manifest.
func (*ImageIndex) RawManifest ¶
func (i *ImageIndex) RawManifest() ([]byte, error)
RawManifest returns the serialized bytes of IndexManifest().
func (*ImageIndex) RemoveImage ¶
func (i *ImageIndex) RemoveImage(hash v1.Hash)
RemoveImage removes image manifest and layers if any from the current image index.
func (*ImageIndex) Size ¶
func (i *ImageIndex) Size() (int64, error)
Size returns the size of the manifest.
type MediaTypeFilter ¶ added in v0.0.6
type Puller ¶
type Puller interface { // Reference returns the image reference to pull. Reference() name.Reference // IndexManifest returns the image hash manifest to pull from. IndexManifest(*v1.IndexManifest) *v1.Hash // Config inspects manifest config descriptor. Config(v1.Descriptor) error // RawConfig parses config blob descriptor content. RawConfig([]byte) error // Layers downloads image blobs. Layers([]v1.Layer) error }
Puller defines the interface for pulling images.