utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// (sblaisdo) sretoolbox also uses /tmp/mtcli to extract binary archive
	DefaultDownloadPath  = "/tmp/mtcli-07b10894-0673-4d95-b6ef-0cbd9701c9c3"
	DefaultCacheDir      = "/tmp/mtcli-07b10894-0673-4d95-b6ef-0cbd9701c9c3"
	DefaultCacheFileName = ".cache"
)
View Source
const AllAddonsIdentifier = "all"

Variables

View Source
var (
	// colors for stdout
	Green            = color.New(color.FgGreen).SprintFunc()
	Red              = color.New(color.FgRed).SprintFunc()
	Yellow           = color.New(color.FgYellow).SprintFunc()
	Bold             = color.New(color.Bold).SprintFunc()
	IntenselyBoldRed = color.New(color.Bold, color.FgHiRed).SprintFunc()
)

Functions

func ExtractAndParseAddons added in v0.2.0

func ExtractAndParseAddons(indexImage, addonIdentifier string) ([]registry.Bundle, error)

func PrintValidationErrors

func PrintValidationErrors(errs []error)

PrintValidationErrors - helper to pretty print validationErrors

Types

type BundleParser added in v0.1.0

type BundleParser interface {
	ParseBundles(addonName string, manifestsPath string) ([]registry.Bundle, error)
}

type DefaultBundleParser added in v0.1.0

type DefaultBundleParser struct{}

func (DefaultBundleParser) ParseBundles added in v0.1.0

func (obj DefaultBundleParser) ParseBundles(addonName, manifestsDir string) ([]registry.Bundle, error)

type DefaultIndexImageExtractor added in v0.1.0

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

func (DefaultIndexImageExtractor) CacheHit added in v0.1.0

func (obj DefaultIndexImageExtractor) CacheHit(key string) bool

func (DefaultIndexImageExtractor) CacheKey added in v0.1.0

func (obj DefaultIndexImageExtractor) CacheKey(indexImage, addonName string) string

func (DefaultIndexImageExtractor) CacheLocation added in v0.1.0

func (obj DefaultIndexImageExtractor) CacheLocation() string

func (DefaultIndexImageExtractor) ExtractBundlesFromImage added in v0.1.0

func (obj DefaultIndexImageExtractor) ExtractBundlesFromImage(indexImage, extractTo string) error

func (DefaultIndexImageExtractor) ExtractionPath added in v0.1.0

func (obj DefaultIndexImageExtractor) ExtractionPath() string

func (DefaultIndexImageExtractor) ManifestsPath added in v0.1.0

func (obj DefaultIndexImageExtractor) ManifestsPath(addonName string) string

func (DefaultIndexImageExtractor) WriteToCache added in v0.1.0

func (obj DefaultIndexImageExtractor) WriteToCache(value string) error

type IndexImageExtractor added in v0.1.0

type IndexImageExtractor interface {
	ExtractBundlesFromImage(indexImage string, extractTo string) error
	CacheKey(indexImage, addonName string) string
	CacheHit(key string) bool
	ExtractionPath() string
	ManifestsPath(addonName string) string
	CacheLocation() string
	WriteToCache(value string) error
}

type MetaBundle added in v0.1.0

type MetaBundle struct {
	AddonMeta *v1alpha1.AddonMetadataSpec
	Bundles   []registry.Bundle
}

func NewMetaBundle added in v0.1.0

func NewMetaBundle(addonMeta *v1alpha1.AddonMetadataSpec, bundles []registry.Bundle) *MetaBundle

TODO: This will return a MetaBundle with corresponding bundle

type MetaLoader added in v0.3.0

type MetaLoader interface {
	Load() (*addonsv1alpha1.AddonMetadataSpec, error)
}

func NewMetaLoader added in v0.3.0

func NewMetaLoader(addonDir, env, version string) MetaLoader

NewMetaLoader - returns default implementation of the AddonMetaLoader

type ValidateFunc added in v0.1.0

type ValidateFunc func(mb MetaBundle) (bool, error)

type Validator added in v0.1.0

type Validator struct {
	Description string
	Runner      ValidateFunc
}

Jump to

Keyboard shortcuts

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