types

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleParser

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

type IndexImageExtractor

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

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

func NewMetaBundle

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

type Middleware

type Middleware func(Validator) Validator

type ValidateFunc

type ValidateFunc func(mb MetaBundle) ValidatorResult

type Validator

type Validator struct {
	Name        string
	Code        string
	Description string
	Runner      ValidateFunc
	// Optional: override defaults from RetryMiddleware
	RetryCount int
	// Optional: override defaults from RetryMiddleware
	RetryDelaySeconds int
}

func (Validator) WithRunner

func (v Validator) WithRunner(fn ValidateFunc) Validator

WithRunner - Needs to create a new validator otherwise the memory address of the original Runner is lost, and it causes infinite loop scenarios (e.g.: RetryMiddleware)

type ValidatorResult

type ValidatorResult struct {
	// true if MetaBundle validation was successful
	Success bool
	// "" if validation is successful, else information about why it failed
	FailureMsg string
	// retports error that happened in the validation code
	Error error
	// if an error occured in the validation code, determines if it was retryable
	RetryableError bool
}

ValidatorResult - encompasses validator result information

func (ValidatorResult) IsError

func (vr ValidatorResult) IsError() bool

func (ValidatorResult) IsRetryableError

func (vr ValidatorResult) IsRetryableError() bool

func (ValidatorResult) IsSuccess

func (vr ValidatorResult) IsSuccess() bool

type ValidatorTest

type ValidatorTest interface {
	Name() string
	Run(MetaBundle) ValidatorResult
	SucceedingCandidates() ([]MetaBundle, error)
	FailingCandidates() ([]MetaBundle, error)
}

Jump to

Keyboard shortcuts

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