image

package
v0.0.0-...-b0c3aa7 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotExists  error = errors.New("hash img not exists")
	ErrImgNotInit error = errors.New("img not init")
)

Functions

func ImageNameAndTag

func ImageNameAndTag(src string) (string, string)

func IsHashImgNotExists

func IsHashImgNotExists(err error) bool

Types

type Image

type Image struct {
	Img    string `json:"img,omitempty"`
	Tag    string `json:"tag,omitempty"`
	ShaHex string `json:"sha_hex,omitempty"`
}

func NewImage

func NewImage(s string) (*Image, error)

func (Image) ID

func (i Image) ID() string

func (Image) IsInit

func (i Image) IsInit() bool

func (Image) String

func (i Image) String() string

type ImageConfig

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

func NewImageConfig

func NewImageConfig(ch *config.Home) *ImageConfig

func (*ImageConfig) GetBasePathForImage

func (i *ImageConfig) GetBasePathForImage(imageShaHex string) string

func (*ImageConfig) GetConfigPathForImage

func (i *ImageConfig) GetConfigPathForImage(imageShaHex string) string

func (*ImageConfig) GetManifestPathForImage

func (i *ImageConfig) GetManifestPathForImage(imageShaHex string) string

func (*ImageConfig) GetTempImagePathForImage

func (i *ImageConfig) GetTempImagePathForImage(imageShaHex string) string

type ImageService

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

func NewImageService

func NewImageService(configHome *config.Home) (*ImageService, error)

func (*ImageService) GetImageMetadata

func (s *ImageService) GetImageMetadata(img *Image) (ret imageMetadata, err error)

func (*ImageService) GetManifestForImage

func (s *ImageService) GetManifestForImage(img *Image) (manifest, error)

func (*ImageService) GetOrPull

func (s *ImageService) GetOrPull(ctx context.Context, img *Image) (*Image, error)

type ImageStore

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

func NewImageStore

func NewImageStore(configHome *config.Home) (*ImageStore, error)

func (*ImageStore) GetImage

func (i *ImageStore) GetImage(img *Image) (*Image, error)

func (*ImageStore) GetImageByHash

func (i *ImageStore) GetImageByHash(shaHex string) (*Image, bool, error)

func (*ImageStore) IsExistByHash

func (i *ImageStore) IsExistByHash(img *Image, shaHex string) bool

func (*ImageStore) IsExistByTag

func (i *ImageStore) IsExistByTag(img *Image) bool

func (*ImageStore) MetadataPath

func (i *ImageStore) MetadataPath() string

func (*ImageStore) MetadataReader

func (i *ImageStore) MetadataReader() (*os.File, error)

func (*ImageStore) MetadataWriter

func (i *ImageStore) MetadataWriter() (*os.File, error)

func (*ImageStore) ParseImagesMetadata

func (i *ImageStore) ParseImagesMetadata() (*imagesDB, error)

func (*ImageStore) StoreImgMetadata

func (i *ImageStore) StoreImgMetadata(img *Image) error

Jump to

Keyboard shortcuts

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