registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultVersion is the default version we use for a Manifest if we cant parse it
	DefaultVersion = version.Must(version.NewVersion("0.0.0"))
	// GitShaRegex is the anchored regex that a pure commit sha matches
	GitShaRegex = regexp.MustCompile(`^[0-9a-f]{4,}$`)
)

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Name string
	Tag  string
	//FSLayers []*schema1.FSLayer
	// LastModified is a synthesized field we extract from History via `lastModified`
	LastModified time.Time
	// Version is a sortable version field, derived from Tag
	Version *version.Version
	Labels  map[string]string
}

Manifest is a combined struct of a v1 manifest, as well as some interesting fields we layer on top.

func DedupeManifests

func DedupeManifests(s []*Manifest) []*Manifest

DedupeManifests will deduplicate a list of Manifests by name:tag

func FromSignedManifest

func FromSignedManifest(sm *schema1.SignedManifest) (*Manifest, error)

FromSignedManifest does some parsing and field extraction from the underlying SignedManifest and returns our sugar object

func NewManifest

func NewManifest(repo string, tag string, lm time.Time, labels map[string]string) (*Manifest, error)

NewManifest creates a new Manifest

func RemoveItems

func RemoveItems(a []*Manifest, b []*Manifest) []*Manifest

removes all items in b from a, returning the list (a-b) this is super shitty timecomplexity but i really dont care

type ManifestModifiedCollection

type ManifestModifiedCollection []*Manifest

ManifestModifiedCollection is a type that implements the sort.Interface interface so that Manifests can be sorted by modification time

func (ManifestModifiedCollection) Len

func (ManifestModifiedCollection) Less

func (v ManifestModifiedCollection) Less(i, j int) bool

func (ManifestModifiedCollection) Swap

func (v ManifestModifiedCollection) Swap(i, j int)

type ManifestVersionCollection

type ManifestVersionCollection []*Manifest

ManifestVersionCollection is a type that implements the sort.Interface interface so that versions can be sorted.

func (ManifestVersionCollection) Len

func (ManifestVersionCollection) Less

func (v ManifestVersionCollection) Less(i, j int) bool

func (ManifestVersionCollection) Swap

func (v ManifestVersionCollection) Swap(i, j int)

Jump to

Keyboard shortcuts

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