Documentation ¶
Overview ¶
This file is to add progress bar support for oras protocol.
Index ¶
- Constants
- func AuthOptn(ociAuth *ocitypes.DockerAuthConfig) remote.Option
- func DownloadImage(ctx context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig, ...) error
- func ImageHash(filePath string) (v1.Hash, error)
- func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, ...) (imagePath string, err error)
- func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom, tmpDir string, ...) (imagePath string, err error)
- func RefHash(ctx context.Context, ref string, ociAuth *ocitypes.DockerAuthConfig, ...) (v1.Hash, error)
- func UploadImage(ctx context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig, ...) error
- type SifImage
- func (si *SifImage) ConfigFile() (*v1.ConfigFile, error)
- func (si *SifImage) ConfigName() (v1.Hash, error)
- func (si *SifImage) Digest() (v1.Hash, error)
- func (si *SifImage) LayerByDiffID(hash v1.Hash) (v1.Layer, error)
- func (si *SifImage) LayerByDigest(hash v1.Hash) (v1.Layer, error)
- func (si *SifImage) Layers() ([]v1.Layer, error)
- func (si *SifImage) Manifest() (*v1.Manifest, error)
- func (si *SifImage) MediaType() (types.MediaType, error)
- func (si *SifImage) RawConfigFile() ([]byte, error)
- func (si *SifImage) RawManifest() ([]byte, error)
- func (si *SifImage) Size() (int64, error)
- type SifLayer
- func (sl *SifLayer) Compressed() (io.ReadCloser, error)
- func (sl *SifLayer) DiffID() (v1.Hash, error)
- func (sl *SifLayer) Digest() (v1.Hash, error)
- func (sl *SifLayer) MediaType() (types.MediaType, error)
- func (sl *SifLayer) Size() (int64, error)
- func (sl *SifLayer) Uncompressed() (io.ReadCloser, error)
Constants ¶
const ( // SifLayerMediaTypeV1 is the mediaType for the "layer" which contains the actual SIF file SifLayerMediaTypeV1 = "application/vnd.sylabs.sif.layer.v1.sif" // SifLayerMediaTypeProto is the mediaType from prototyping and Singularity // <3.7 which unfortunately includes a typo and doesn't have a version suffix // See: https://github.com/hpcng/singularity/issues/4437 SifLayerMediaTypeProto = "appliciation/vnd.sylabs.sif.layer.tar" )
const (
// SifConfigMediaTypeV1 is the config descriptor mediaType for a SIF image.
SifConfigMediaTypeV1 = "application/vnd.sylabs.sif.config.v1+json"
)
Variables ¶
This section is empty.
Functions ¶
func DownloadImage ¶
func DownloadImage(ctx context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig, noHTTPS bool) error
DownloadImage downloads a SIF image specified by an oci reference to a file using the included credentials
func Pull ¶
func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, ociAuth *ocitypes.DockerAuthConfig, noHTTPS bool) (imagePath string, err error)
Pull will pull an oras image to the cache or direct to a temporary file if cache is disabled
func PullToFile ¶
func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom, tmpDir string, ociAuth *ocitypes.DockerAuthConfig, noHTTPS bool) (imagePath string, err error)
PullToFile will pull an oras image to the specified location, through the cache, or directly if cache is disabled
func RefHash ¶ added in v1.3.0
func RefHash(ctx context.Context, ref string, ociAuth *ocitypes.DockerAuthConfig, noHTTPS bool) (v1.Hash, error)
RefHash returns the digest of the SIF layer of the OCI manifest for supplied ref
func UploadImage ¶
func UploadImage(ctx context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig, noHTTPS bool) error
UploadImage uploads the image specified by path and pushes it to the provided oci reference, it will use credentials if supplied
Types ¶
type SifImage ¶ added in v1.3.0
type SifImage struct {
// contains filtered or unexported fields
}
SifImage implements a go-containerregistry v1.Image representing an ORAS / OCI artifact of a single SIF image.
func NewImageFromSIF ¶ added in v1.3.0
func (*SifImage) ConfigFile ¶ added in v1.3.0
func (si *SifImage) ConfigFile() (*v1.ConfigFile, error)
ConfigFile returns the hash of the image's config file, also known as the Image ID.
func (*SifImage) ConfigName ¶ added in v1.3.0
ConfigName returns the hash of the image's config file, also known as the Image ID.
func (*SifImage) LayerByDiffID ¶ added in v1.3.0
LayerByDiffID is an analog to LayerByDigest, looking up by "diff id" (the uncompressed hash).
func (*SifImage) LayerByDigest ¶ added in v1.3.0
LayerByDigest returns a Layer for interacting with a particular layer of the image, looking it up by "digest" (the compressed hash).
func (*SifImage) Layers ¶ added in v1.3.0
Layers returns the ordered collection of filesystem layers that comprise this image. The order of the list is oldest/base layer first, and most-recent/top layer last.
func (*SifImage) RawConfigFile ¶ added in v1.3.0
RawConfigFile returns the serialized bytes of ConfigFile().
func (*SifImage) RawManifest ¶ added in v1.3.0
RawManifest returns the serialized bytes of Manifest()
type SifLayer ¶ added in v1.3.0
type SifLayer struct {
// contains filtered or unexported fields
}
SifLayer implements a go-containerregistry v1.Layer backed by a SIF file, for ORAS / OCI artifact usage.
func NewLayerFromSIF ¶ added in v1.3.0
NewLayerFromSIF creates a new layer, backed by file, with mt as the MediaType. The MediaType should always be set SifLayerMediaTypeV1 in production. It is configurable so that we can implement tests which use the old prototype media value.
func (*SifLayer) Compressed ¶ added in v1.3.0
func (sl *SifLayer) Compressed() (io.ReadCloser, error)
func (*SifLayer) Uncompressed ¶ added in v1.3.0
func (sl *SifLayer) Uncompressed() (io.ReadCloser, error)