Documentation ¶
Index ¶
- Variables
- func InitializeImageCache(client *client.PortLayer) error
- func NewRepositoryCache(client *client.PortLayer) error
- type Association
- type CCache
- func (cc *CCache) AddContainer(container *container.VicContainer)
- func (cc *CCache) AddExecToContainer(container *container.VicContainer, eid string)
- func (cc *CCache) DeleteContainer(nameOrID string)
- func (cc *CCache) GetContainer(nameOrID string) *container.VicContainer
- func (cc *CCache) GetContainerByName(nameOnly string) *container.VicContainer
- func (cc *CCache) GetContainerFromExec(eid string) *container.VicContainer
- func (cc *CCache) ReleaseName(name string)
- func (cc *CCache) ReserveName(container *container.VicContainer, name string) error
- func (cc *CCache) UpdateContainerName(oldName, newName string) error
- type ICache
- func (ic *ICache) Add(imageConfig *metadata.ImageConfig) error
- func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error)
- func (ic *ICache) GetImages() []*metadata.ImageConfig
- func (ic *ICache) IsImageID(id string) bool
- func (ic *ICache) RemoveImageByConfig(imageConfig *metadata.ImageConfig)
- func (ic *ICache) Save() error
- type Repo
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDoesNotExist returned if a reference is not found in the // store. ErrDoesNotExist = errors.New("reference does not exist") )
Functions ¶
func InitializeImageCache ¶
InitializeImageCache will create a new image cache or rehydrate an existing image cache from the portlayer k/v store
func NewRepositoryCache ¶
NewRespositoryCache will create a new repoCache or rehydrate an existing repoCache from the portlayer k/v store
Types ¶
type Association ¶
An Association is a tuple associating a reference with an image ID.
type CCache ¶
type CCache struct {
// contains filtered or unexported fields
}
Tracks our container info from calls
func ContainerCache ¶
func ContainerCache() *CCache
ContainerCache returns a reference to the container cache
func (*CCache) AddContainer ¶
func (cc *CCache) AddContainer(container *container.VicContainer)
func (*CCache) AddExecToContainer ¶
func (cc *CCache) AddExecToContainer(container *container.VicContainer, eid string)
func (*CCache) DeleteContainer ¶
func (*CCache) GetContainer ¶
func (cc *CCache) GetContainer(nameOrID string) *container.VicContainer
func (*CCache) GetContainerByName ¶
func (cc *CCache) GetContainerByName(nameOnly string) *container.VicContainer
GetContainerByName returns a container whose name "exactly" matches nameOnly
func (*CCache) GetContainerFromExec ¶
func (cc *CCache) GetContainerFromExec(eid string) *container.VicContainer
func (*CCache) ReleaseName ¶
ReleaseName is used during a container rename operation to allow concurrent container create/rename operations to use the name. It is also used during a failed create operation to allow subsequent create operations to use that name.
func (*CCache) ReserveName ¶
func (cc *CCache) ReserveName(container *container.VicContainer, name string) error
ReserveName is used during a container create/rename operation to prevent concurrent container create/rename operations from grabbing the new name.
func (*CCache) UpdateContainerName ¶
UpdateContainerName assumes that the newName is already reserved by ReserveName so no need to check the existence of a container with the new name.
type ICache ¶
type ICache struct {
// contains filtered or unexported fields
}
ICache is an in-memory cache of image metadata. It is refreshed at startup by a call to the portlayer. It is updated when new images are pulled or images are deleted.
func (*ICache) Add ¶
func (ic *ICache) Add(imageConfig *metadata.ImageConfig) error
Add adds an image to the image cache
func (*ICache) Get ¶
func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error)
Get parses input to retrieve a cached image
func (*ICache) GetImages ¶
func (ic *ICache) GetImages() []*metadata.ImageConfig
GetImages returns a slice containing metadata for all cached images
func (*ICache) RemoveImageByConfig ¶
func (ic *ICache) RemoveImageByConfig(imageConfig *metadata.ImageConfig)
RemoveImageByConfig removes image from the cache.
type Repo ¶
type Repo interface { References(imageID string) []reference.Named ReferencesByName(ref reference.Named) []Association Delete(ref reference.Named, save bool) (bool, error) Get(ref reference.Named) (string, error) Save() error GetImageID(layerID string) string Tags(imageID string) []string Digests(imageID string) []string AddReference(ref reference.Named, imageID string, force bool, layerID string, save bool) error // Remove will remove from the cache and returns the // stringified Named if successful -- save bool instructs // func to persist to portlayer k/v or not Remove(ref string, save bool) (string, error) }
Repo provides the set of methods which can operate on a tag store.
func RepositoryCache ¶
func RepositoryCache() Repo
RepositoryCache returns a ref to the repoCache interface