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 LayerOption
- type LayerOptions
- type LocalFileLayer
- func (l *LocalFileLayer) Annotations() map[string]string
- func (l *LocalFileLayer) Compressed() (io.ReadCloser, error)
- func (l *LocalFileLayer) DiffID() (v1.Hash, error)
- func (l *LocalFileLayer) Digest() (_ v1.Hash, err error)
- func (l *LocalFileLayer) MediaType() (types.MediaType, error)
- func (l *LocalFileLayer) Platform() *v1.Platform
- func (l *LocalFileLayer) Size() (int64, error)
- func (l *LocalFileLayer) Uncompressed() (io.ReadCloser, error)
- type ManifestConfig
- type MediaTypeFilter
- type Puller
- type Pusher
- type StreamLayer
- func (sl *StreamLayer) Annotations() map[string]string
- func (sl *StreamLayer) Close() error
- func (sl *StreamLayer) Compressed() (io.ReadCloser, error)
- func (sl *StreamLayer) DiffID() (v1.Hash, error)
- func (sl *StreamLayer) Digest() (v1.Hash, error)
- func (sl *StreamLayer) MediaType() (types.MediaType, error)
- func (sl *StreamLayer) Platform() *v1.Platform
- func (sl *StreamLayer) Size() (int64, error)
- func (sl *StreamLayer) Uncompressed() (io.ReadCloser, error)
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 artifacts 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 LayerOption ¶ added in v0.0.20
type LayerOption func(*LayerOptions)
func WithLayerAnnotations ¶ added in v0.0.20
func WithLayerAnnotations(annotations map[string]string) LayerOption
func WithLayerMediaType ¶ added in v0.0.20
func WithLayerMediaType(mediaType string) LayerOption
func WithLayerPlatform ¶ added in v0.0.20
func WithLayerPlatform(platform *v1.Platform) LayerOption
type LayerOptions ¶ added in v0.0.20
type LayerOptions struct {
// contains filtered or unexported fields
}
type LocalFileLayer ¶ added in v0.0.10
type LocalFileLayer struct {
// contains filtered or unexported fields
}
LocalFileLayer defines an OCI layer descriptor associated to a local file.
func NewLocalFileLayer ¶ added in v0.0.10
func NewLocalFileLayer(path string, options ...LayerOption) *LocalFileLayer
NewLocalLayer returns an OCI layer descriptor for the corresponding local file.
func (*LocalFileLayer) Annotations ¶ added in v0.0.10
func (l *LocalFileLayer) Annotations() map[string]string
Annotations returns annotations associated to this layer.
func (*LocalFileLayer) Compressed ¶ added in v0.0.10
func (l *LocalFileLayer) Compressed() (io.ReadCloser, error)
Compressed returns an io.ReadCloser for the file content.
func (*LocalFileLayer) DiffID ¶ added in v0.0.10
func (l *LocalFileLayer) DiffID() (v1.Hash, error)
DiffID returns the Hash of the uncompressed layer (not supported by ORAS).
func (*LocalFileLayer) Digest ¶ added in v0.0.10
func (l *LocalFileLayer) Digest() (_ v1.Hash, err error)
Digest returns the Hash of the local file.
func (*LocalFileLayer) MediaType ¶ added in v0.0.10
func (l *LocalFileLayer) MediaType() (types.MediaType, error)
MediaType returns the media type of the Layer.
func (*LocalFileLayer) Platform ¶ added in v0.0.10
func (l *LocalFileLayer) Platform() *v1.Platform
Platform returns platform information for this layer.
func (*LocalFileLayer) Size ¶ added in v0.0.10
func (l *LocalFileLayer) Size() (int64, error)
Size returns the size of the local file.
func (*LocalFileLayer) Uncompressed ¶ added in v0.0.10
func (l *LocalFileLayer) Uncompressed() (io.ReadCloser, error)
Uncompressed returns an io.ReadCloser for the uncompressed layer contents (not supported by ORAS).
type ManifestConfig ¶ added in v0.0.10
ManifestConfig defines the interface for manifest configs.
func NewManifestConfig ¶ added in v0.0.10
func NewManifestConfig(mediaType string, rawConfig []byte) ManifestConfig
NewManifestConfig returns a ManifestConfig to push.
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.
type Pusher ¶
type Pusher interface { // Reference returns the image reference to pull. Reference() name.Reference ImageIndex() (v1.ImageIndex, error) Image() (v1.Image, error) }
func NewGenericPusher ¶ added in v0.0.10
func NewGenericPusher(ref name.Reference, manifestConfig ManifestConfig, layer Layer) Pusher
NewGenericPusher returns a pusher to push a manifest and a blob to a registry.
type StreamLayer ¶ added in v0.0.20
StreamLayer defines an OCI layer descriptor associated to a stream.
func NewStreamLayer ¶ added in v0.0.20
func NewStreamLayer(stream io.Reader, options ...LayerOption) *StreamLayer
NewStreamLayer returns an OCI layer descriptor for the corresponding stream.
func (*StreamLayer) Annotations ¶ added in v0.0.20
func (sl *StreamLayer) Annotations() map[string]string
Annotations returns annotations associated to this layer.
func (*StreamLayer) Close ¶ added in v0.0.20
func (sl *StreamLayer) Close() error
Close closes the underlying stream and computes the digest.
func (*StreamLayer) Compressed ¶ added in v0.0.20
func (sl *StreamLayer) Compressed() (io.ReadCloser, error)
Compressed returns an io.ReadCloser for the file content.
func (*StreamLayer) DiffID ¶ added in v0.0.20
func (sl *StreamLayer) DiffID() (v1.Hash, error)
DiffID returns the Hash of the uncompressed layer (not supported by ORAS).
func (*StreamLayer) Digest ¶ added in v0.0.20
func (sl *StreamLayer) Digest() (v1.Hash, error)
Digest returns the Hash of the consumed stream.
func (*StreamLayer) MediaType ¶ added in v0.0.20
func (sl *StreamLayer) MediaType() (types.MediaType, error)
MediaType returns the media type of the Layer.
func (*StreamLayer) Platform ¶ added in v0.0.20
func (sl *StreamLayer) Platform() *v1.Platform
Platform returns platform information for this layer.
func (*StreamLayer) Size ¶ added in v0.0.20
func (sl *StreamLayer) Size() (int64, error)
Size returns the size of the consumed stream.
func (*StreamLayer) Uncompressed ¶ added in v0.0.20
func (sl *StreamLayer) Uncompressed() (io.ReadCloser, error)
Uncompressed returns an io.ReadCloser for the uncompressed layer contents (not supported by ORAS).