github.com/dean7474/operator-registry@v1.21.1-0.20220418203638-d4717f98c2e5/pkg/image/registry.go (about)

     1  package image
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  // Registry knows how to Pull and Unpack Operator Bundle images to the filesystem.
     8  // Note: In the future, Registry will know how to Build and Push Operator Bundle images as well.
     9  type Registry interface {
    10  	// Pull fetches and stores an image by reference.
    11  	Pull(ctx context.Context, ref Reference) error
    12  
    13  	// Push uploads an image to the remote registry of its reference.
    14  	// If the referenced image does not exist in the registry, an error is returned.
    15  	// Push(ctx context.Context, ref string) error
    16  
    17  	// Unpack writes the unpackaged content of an image to a directory.
    18  	// If the referenced image does not exist in the registry, an error is returned.
    19  	Unpack(ctx context.Context, ref Reference, dir string) error
    20  
    21  	// Labels gets the labels for an image that is already stored.
    22  	Labels(ctx context.Context, ref Reference) (map[string]string, error)
    23  
    24  	// Destroy cleans up any on-disk resources used to track images
    25  	Destroy() error
    26  
    27  	// Pack creates and stores an image based on the given reference and returns a reference to the new image.
    28  	// If the referenced image does not exist in the registry, a new image is created from scratch.
    29  	// If it exists, it's used as the base image.
    30  	// Pack(ctx context.Context, ref Reference, from io.Reader) (next string, err error)
    31  }