registry

package
v0.0.0-...-c4a70ba Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ItemInSlice

func ItemInSlice(item string, slice []string) bool

ItemInSlice check if item is an element of slice

func PrettySize

func PrettySize(size float64) string

PrettySize format bytes in more readable units.

func PurgeOldTags

func PurgeOldTags(client *Client, purgeDryRun bool, purgeIncludeRepos, purgeExcludeRepos string)

PurgeOldTags purge old tags.

func SetupLogging

func SetupLogging(name string) *logrus.Entry

SetupLogging setup logger

func SortedMapKeys

func SortedMapKeys(m interface{}) []string

SortedMapKeys sort keys of the map where values can be of any type.

func UniqueSortedSlice

func UniqueSortedSlice(slice []string) []string

UniqueSortedSlice filter out duplicate items from slice

Types

type Client

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

Client main class.

func NewClient

func NewClient() *Client

NewClient initialize Client.

func (*Client) CountTags

func (c *Client) CountTags(interval int)

CountTags count repository tags in background regularly.

func (*Client) DeleteTag

func (c *Client) DeleteTag(repoPath, tag string)

DeleteTag delete image tag.

func (*Client) GetImageCreated

func (c *Client) GetImageCreated(imageRef string) time.Time

GetImageCreated get image created time

func (*Client) GetImageInfo

func (c *Client) GetImageInfo(imageRef string) (ImageInfo, error)

GetImageInfo get image info by the reference - tag name or digest sha256.

func (*Client) GetRepos

func (c *Client) GetRepos() []string

GetRepos get all repos

func (*Client) IsCatalogReady

func (c *Client) IsCatalogReady() bool

IsCatalogReady whether catalog is ready for the first time use

func (*Client) ListTags

func (c *Client) ListTags(repoName string) []string

ListTags get tags for the repo

func (*Client) RefreshCatalog

func (c *Client) RefreshCatalog()

func (*Client) StartBackgroundJobs

func (c *Client) StartBackgroundJobs()

func (*Client) SubRepoTagCounts

func (c *Client) SubRepoTagCounts(repoPath string, repos []string) map[string]int

SubRepoTagCounts return map with tag counts according to the provided list of repos/sub-repos etc.

type ImageInfo

type ImageInfo struct {
	IsImageIndex   bool
	IsImage        bool
	ImageRefRepo   string
	ImageRefTag    string
	ImageRefDigest string
	MediaType      string
	Platforms      string
	Manifest       map[string]interface{}

	// Image specific
	ImageSize     int64
	Created       time.Time
	ConfigImageID string
	ConfigFile    map[string]interface{}
}

type TagData

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

func (TagData) String

func (t TagData) String() string

Jump to

Keyboard shortcuts

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