lstags: github.com/ivanilves/lstags/tag Index | Files | Directories

package tag

import "github.com/ivanilves/lstags/tag"

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

Package Files

tag.go

func Join Uses

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

type Options Uses

type Options struct {
    Digest  string
    ImageID string
    Created int64
}

Options holds optional parameters for Tag creation

type Tag Uses

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

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

func Collect Uses

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 Uses

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

New creates a new instance of Tag

func (*Tag) GetCreated Uses

func (tg *Tag) GetCreated() int64

GetCreated gets image creation timestamp

func (*Tag) GetCreatedKey Uses

func (tg *Tag) GetCreatedKey() string

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

func (*Tag) GetCreatedString Uses

func (tg *Tag) GetCreatedString() string

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

func (*Tag) GetDigest Uses

func (tg *Tag) GetDigest() string

GetDigest gets tagged image's digest

func (*Tag) GetImageID Uses

func (tg *Tag) GetImageID() string

GetImageID gets local Docker image ID

func (*Tag) GetShortDigest Uses

func (tg *Tag) GetShortDigest() string

GetShortDigest gets shorter form of tagged image's digest

func (*Tag) GetState Uses

func (tg *Tag) GetState() string

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

func (*Tag) HasImageID Uses

func (tg *Tag) HasImageID() bool

HasImageID tells us if Docker image has an ID defined

func (*Tag) Name Uses

func (tg *Tag) Name() string

Name gets tag name

func (*Tag) NeedsPull Uses

func (tg *Tag) NeedsPull() bool

NeedsPull tells us if tag/image needs pull

func (*Tag) NeedsPush Uses

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

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

func (*Tag) SortKey Uses

func (tg *Tag) SortKey() string

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

Directories

PathSynopsis
local
manifest
remote

Package tag imports 5 packages (graph) and is imported by 5 packages. Updated 2019-10-03. Refresh now. Tools for package owners.