github.com/buildpack/pack@v0.5.0/interfaces.go (about)

     1  package pack
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/buildpack/pack/blob"
     7  
     8  	"github.com/buildpack/imgutil"
     9  )
    10  
    11  //go:generate mockgen -package testmocks -destination testmocks/mock_image_fetcher.go github.com/buildpack/pack ImageFetcher
    12  
    13  type ImageFetcher interface {
    14  	// Fetch fetches an image by resolving it both remotely and locally depending on provided parameters.
    15  	// If daemon is true, it will look return a `local.Image`. Pull, applicable only when daemon is true, will
    16  	// attempt to pull a remote image first.
    17  	Fetch(ctx context.Context, name string, daemon, pull bool) (imgutil.Image, error)
    18  }
    19  
    20  //go:generate mockgen -package testmocks -destination testmocks/mock_downloader.go github.com/buildpack/pack Downloader
    21  
    22  type Downloader interface {
    23  	Download(ctx context.Context, pathOrURI string) (blob.Blob, error)
    24  }
    25  
    26  //go:generate mockgen -package testmocks -destination testmocks/mock_image_factory.go github.com/buildpack/pack ImageFactory
    27  
    28  type ImageFactory interface {
    29  	NewImage(repoName string, local bool) (imgutil.Image, error)
    30  }