storage

package
v1.1.0-alpha.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLockManager

type FileLockManager struct {
	// contains filtered or unexported fields
}

func (*FileLockManager) LockAllImagesReadOnly

func (lockManager *FileLockManager) LockAllImagesReadOnly(projectName string) error

func (*FileLockManager) LockImage

func (lockManager *FileLockManager) LockImage(imageName string) error

func (*FileLockManager) LockStage

func (lockManager *FileLockManager) LockStage(projectName, signature string) error

func (*FileLockManager) LockStageCache

func (lockManager *FileLockManager) LockStageCache(projectName, signature string) error

func (*FileLockManager) ReleaseAllStageLocks

func (lockManager *FileLockManager) ReleaseAllStageLocks() error

func (*FileLockManager) UnlockAllImages

func (lockManager *FileLockManager) UnlockAllImages(projectName string) error

func (*FileLockManager) UnlockImage

func (lockManager *FileLockManager) UnlockImage(imageName string) error

func (*FileLockManager) UnlockStage

func (lockManager *FileLockManager) UnlockStage(projectName, signature string) error

func (*FileLockManager) UnlockStageCache

func (lockManager *FileLockManager) UnlockStageCache(projectName, signature string) error

type FileStagesStorageCache

type FileStagesStorageCache struct {
	CacheDir string
}

func NewFileStagesStorageCache

func NewFileStagesStorageCache(cacheDir string) *FileStagesStorageCache

func (*FileStagesStorageCache) GetImagesBySignature

func (cache *FileStagesStorageCache) GetImagesBySignature(projectName, signature string) (bool, []*ImageInfo, error)

func (*FileStagesStorageCache) StoreImagesBySignature

func (cache *FileStagesStorageCache) StoreImagesBySignature(projectName, signature string, imagesDescs []*ImageInfo) error

type ImageInfo

type ImageInfo struct {
	Signature         string            `json:"signature"`
	ImageName         string            `json:"imageName"`
	Labels            map[string]string `json:"labels"`
	CreatedAtUnixNano int64             `json:"createdAtUnixNano"`
}

func (*ImageInfo) CreatedAt

func (info *ImageInfo) CreatedAt() time.Time

type ImageInfosCacheData

type ImageInfosCacheData struct {
	ImagesDescs []*ImageInfo `json:"imagesDescs"`
}

type LocalStagesStorage

type LocalStagesStorage struct{}

func (*LocalStagesStorage) GetImagesBySignature

func (storage *LocalStagesStorage) GetImagesBySignature(projectName, signature string) ([]*ImageInfo, error)

func (*LocalStagesStorage) StoreStageImage

func (storage *LocalStagesStorage) StoreStageImage(stageImage image.ImageInterface) error

func (*LocalStagesStorage) String

func (storage *LocalStagesStorage) String() string

func (*LocalStagesStorage) SyncStageImage

func (storage *LocalStagesStorage) SyncStageImage(stageImage image.ImageInterface) error

type LockManager

type LockManager interface {
	LockStage(projectName, signature string) error
	UnlockStage(projectName, signature string) error
	LockStageCache(projectName, signature string) error
	UnlockStageCache(projectName, signature string) error
	LockImage(imageName string) error
	UnlockImage(imageName string) error
}

type StagesStorage

type StagesStorage interface {
	// TODO cleanup GetAllImages() ([]StageImage, error)
	GetImagesBySignature(projectName, signature string) ([]*ImageInfo, error)

	// в том числе docker pull из registry + image.SyncDockerState
	// lock по имени image чтобы не делать 2 раза pull одновременно
	SyncStageImage(stageImage image.ImageInterface) error
	StoreStageImage(stageImage image.ImageInterface) error

	String() string
}

type StagesStorageCache

type StagesStorageCache interface {
	GetImagesBySignature(projectName, signature string) (bool, []*ImageInfo, error)
	StoreImagesBySignature(projectName, signature string, imageInfo []*ImageInfo) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL