image

package
v1.2.200 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	WerfLabelPrefix               = "werf"
	WerfLabel                     = "werf"
	WerfVersionLabel              = "werf-version"
	WerfCacheVersionLabel         = "werf-cache-version"
	WerfImageLabel                = "werf-image"
	WerfDevLabel                  = "werf-dev"
	WerfDockerImageName           = "werf-docker-image-name"
	WerfStageDigestLabel          = "werf-stage-digest"
	WerfStageContentDigestLabel   = "werf-stage-content-digest"
	WerfProjectRepoCommitLabel    = "werf-project-repo-commit"
	WerfImportChecksumLabelPrefix = "werf-import-checksum-"

	WerfImportMetadataChecksumLabel       = "checksum"
	WerfImportMetadataSourceImageIDLabel  = "source-image-id"
	WerfImportMetadataImportSourceIDLabel = "import-source-id"

	WerfCustomTagMetadataStageIDLabel = "stage-id"
	WerfCustomTagMetadataTag          = "tag"

	WerfMountTmpDirLabel          = "werf-mount-type-tmp-dir"
	WerfMountBuildDirLabel        = "werf-mount-type-build-dir"
	WerfMountCustomDirLabelPrefix = "werf-mount-type-custom-dir-"

	BuildCacheVersion = "1.2"

	StageContainerNamePrefix = "werf.build."
)
View Source
const (
	ManifestCacheVersion = "4"
)

Variables

This section is empty.

Functions

func Init

func Init() error

func MustParseTimestampString

func MustParseTimestampString(timestampString string) time.Time

func ParseRepositoryAndTag

func ParseRepositoryAndTag(ref string) (string, string)

func ParseUniqueIDAsTimestamp

func ParseUniqueIDAsTimestamp(uniqueID string) (int64, error)

Types

type CustomTagFunc added in v1.2.114

type CustomTagFunc func(string, string) string

type ExportTagFunc added in v1.2.114

type ExportTagFunc func(string, string) string

type Info

type Info struct {
	Name       string `json:"name"`
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
	RepoDigest string `json:"repoDigest"`

	OnBuild           []string          `json:"onBuild"`
	Env               []string          `json:"env"`
	ID                string            `json:"ID"`
	ParentID          string            `json:"parentID"`
	Labels            map[string]string `json:"labels"`
	Size              int64             `json:"size"`
	CreatedAtUnixNano int64             `json:"createdAtUnixNano"`
}

func NewImageInfoFromRegistryConfig added in v1.2.190

func NewImageInfoFromRegistryConfig(ref string, cfg *v1.ConfigFile) *Info

func NewInfoFromInspect

func NewInfoFromInspect(ref string, inspect *types.ImageInspect) *Info

func (*Info) GetCopy added in v1.2.190

func (info *Info) GetCopy() *Info

func (*Info) GetCreatedAt

func (info *Info) GetCreatedAt() time.Time

func (*Info) SetCreatedAtUnix

func (info *Info) SetCreatedAtUnix(seconds int64)

func (*Info) SetCreatedAtUnixNano

func (info *Info) SetCreatedAtUnixNano(seconds int64)

type InfoGetter added in v1.2.0

type InfoGetter struct {
	WerfImageName string
	Repo          string
	Tag           string

	InfoGetterOptions
}

func NewInfoGetter added in v1.2.0

func NewInfoGetter(imageName, ref string, opts InfoGetterOptions) *InfoGetter

func (*InfoGetter) GetName added in v1.2.0

func (d *InfoGetter) GetName() string

func (*InfoGetter) GetTag added in v1.2.0

func (d *InfoGetter) GetTag() string

func (*InfoGetter) GetWerfImageName added in v1.2.0

func (d *InfoGetter) GetWerfImageName() string

func (*InfoGetter) IsNameless added in v1.2.0

func (d *InfoGetter) IsNameless() bool

type InfoGetterOptions added in v1.2.114

type InfoGetterOptions struct {
	CustomTagFunc CustomTagFunc
}

type ManifestCache

type ManifestCache struct {
	CacheDir string
}
var CommonManifestCache *ManifestCache

func NewManifestCache

func NewManifestCache(cacheDir string) *ManifestCache

func (*ManifestCache) GetImageInfo

func (cache *ManifestCache) GetImageInfo(ctx context.Context, storageName, imageName string) (*Info, error)

func (*ManifestCache) StoreImageInfo

func (cache *ManifestCache) StoreImageInfo(ctx context.Context, storageName string, imgInfo *Info) error

type ManifestCacheRecord

type ManifestCacheRecord struct {
	AccessTimestamp int64
	Info            *Info
}

type StageDescription

type StageDescription struct {
	StageID *StageID `json:"stageID"`
	Info    *Info    `json:"info"`
}

func (*StageDescription) GetCopy added in v1.2.190

func (desc *StageDescription) GetCopy() *StageDescription

type StageID

type StageID struct {
	Digest   string `json:"digest"`
	UniqueID int64  `json:"uniqueID"`
}

func (StageID) IsEqual added in v1.2.16

func (id StageID) IsEqual(another StageID) bool

func (StageID) String

func (id StageID) String() string

func (StageID) UniqueIDAsTime

func (id StageID) UniqueIDAsTime() time.Time

Jump to

Keyboard shortcuts

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