tagStore

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageTag

type ImageTag struct {
	Name       string `json:"name"`
	BaseTag    string `json:"baseTag"`
	PatchLevel int    `json:"patchLevel"`
}

func NewImageTag

func NewImageTag(fullTag string) (*ImageTag, error)

NewImageTag parses a fully qualified image tag and creates an ImageTag struct

func (*ImageTag) GetCurrentTag

func (it *ImageTag) GetCurrentTag() string

func (*ImageTag) GetNextPatchTag

func (it *ImageTag) GetNextPatchTag() string

func (*ImageTag) IncrementPatch

func (it *ImageTag) IncrementPatch()

type Matrix

type Matrix struct {
	Image_name     string `json:"image_name"`
	Next_patch_tag string `json:"next_patch_tag"`
}

type TagStore

type TagStore struct {
	ImageMap map[string]*ImageTag // Map for storage and fast lookups
}

TagStore type that only uses a map

func New

func New() *TagStore

NewImageRegistry creates a new registry

func (*TagStore) AddImage

func (reg *TagStore) AddImage(fullTag string) error

AddImage adds an image to the registry if it doesn't already exist

func (*TagStore) Flatten

func (reg *TagStore) Flatten() []string

Flatten converts the map to a slice for JSON output

func (*TagStore) FlattenWithOptions

func (reg *TagStore) FlattenWithOptions(includeNextTag bool) interface{}

TODO: include tag strategy as param

func (*TagStore) GetImage

func (reg *TagStore) GetImage(name, baseTag string) (*ImageTag, bool)

GetImage retrieves an image if it exists

func (*TagStore) GetJSON

func (reg *TagStore) GetJSON(includeNextTag bool) (string, error)

GetJSON returns the images as JSON

func (*TagStore) PatchImage

func (reg *TagStore) PatchImage(name, baseTag string) (string, bool)

PatchImage increments the patch level for an image if it exists

func (*TagStore) PrintTable

func (reg *TagStore) PrintTable(includeNextTag bool) (string, error)

Jump to

Keyboard shortcuts

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