tag

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tag provides Tag abstraction to handle Docker tags (images) and their differences between remote registries and Docker daemon, i.e. what tags ara available in remote Docker registry, do we have them pulled in our local system, or do we have the same tags in our own local registry etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(
	remoteTags, localTags map[string]*Tag,
	assumedTagNames []string,
) ([]string, map[string]string, map[string]*Tag)

Join joins local tags with ones from registry, performs state processing and returns: * sorted slice of sort keys * joined map of [sortKey]name * joined map of [name]*Tag

Types

type Options added in v1.0.71

type Options struct {
	Digest  string
	ImageID string
	Created int64
}

Options holds optional parameters for Tag creation

type Tag

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

Tag aggregates tag-related information: tag name, image digest etc

func Collect

func Collect(keys []string, tagNames map[string]string, tagMap map[string]*Tag) []*Tag

Collect organizes tags structures the way they could be used by API

func New

func New(name string, options Options) (*Tag, error)

New creates a new instance of Tag

func (*Tag) GetCreated

func (tg *Tag) GetCreated() int64

GetCreated gets image creation timestamp

func (*Tag) GetCreatedKey

func (tg *Tag) GetCreatedKey() string

GetCreatedKey gets image creation timestamp in a string form (for a string sort e.g.)

func (*Tag) GetCreatedString

func (tg *Tag) GetCreatedString() string

GetCreatedString gets image creation timestamp in a human-readable string form

func (*Tag) GetDigest

func (tg *Tag) GetDigest() string

GetDigest gets tagged image's digest

func (*Tag) GetImageID

func (tg *Tag) GetImageID() string

GetImageID gets local Docker image ID

func (*Tag) GetShortDigest

func (tg *Tag) GetShortDigest() string

GetShortDigest gets shorter form of tagged image's digest

func (*Tag) GetState

func (tg *Tag) GetState() string

GetState gets tag state (a difference between local tag and its remote counterpart)

func (*Tag) HasImageID

func (tg *Tag) HasImageID() bool

HasImageID tells us if Docker image has an ID defined

func (*Tag) Name

func (tg *Tag) Name() string

Name gets tag name

func (*Tag) NeedsPull

func (tg *Tag) NeedsPull() bool

NeedsPull tells us if tag/image needs pull

func (*Tag) NeedsPush

func (tg *Tag) NeedsPush(doUpdate bool) bool

NeedsPush tells us if tag/image needs push to a registry

func (*Tag) SortKey

func (tg *Tag) SortKey() string

SortKey returns a sort key (used to sort tags before process or display them)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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