github.com/jcarley/cli@v0.0.0-20180201210820-966d90434c30/lib/images/contract.go (about)

     1  package images
     2  
     3  import (
     4  	"github.com/daticahealth/cli/lib/prompts"
     5  	"github.com/daticahealth/cli/models"
     6  	notaryClient "github.com/docker/notary/client"
     7  	"github.com/docker/notary/client/changelist"
     8  )
     9  
    10  // IImages describes container-image-related functionality
    11  type IImages interface {
    12  	ListImages() (*[]string, error)
    13  	ListTags(imageName string) (*[]string, error)
    14  	DeleteTag(imageName, tagName string) error
    15  	Push(name string, user *models.User, env *models.Environment, ip prompts.IPrompts) (*models.Image, error)
    16  	Pull(name string, target *Target, user *models.User, env *models.Environment) error
    17  	InitNotaryRepo(repo notaryClient.Repository, rootKeyPath string) error
    18  	AddTargetHash(repo notaryClient.Repository, digest *models.ContentDigest, tag string, publish bool) error
    19  	ListTargets(repo notaryClient.Repository, roles ...string) ([]*Target, error)
    20  	LookupTarget(repo notaryClient.Repository, tag string) (*Target, error)
    21  	DeleteTargets(repo notaryClient.Repository, tags []string, publish bool) error
    22  	PrintChangelist(changes []changelist.Change)
    23  	CheckChangelist(repo notaryClient.Repository, ip prompts.IPrompts) error
    24  	GetNotaryRepository(pod, imageName string, user *models.User) notaryClient.Repository
    25  	GetGloballyUniqueNamespace(name string, env *models.Environment, includeRegistry bool) (string, string, error)
    26  	Publish(repo notaryClient.Repository) error
    27  }
    28  
    29  // SImages is a concrete implementation of IImages
    30  type SImages struct {
    31  	Settings *models.Settings
    32  }
    33  
    34  // New constructs an implementation of IImages
    35  func New(settings *models.Settings) IImages {
    36  	return &SImages{Settings: settings}
    37  }