addon

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFetchingError

func IsFetchingError(err error) bool

IsFetchingError returns true only if given error represents the fetching error kind

func IsLoadingError

func IsLoadingError(err error) bool

IsLoadingError returns true only if given error represents the loading error kind

func NewFetchingError

func NewFetchingError(err error) error

NewFetchingError returns new fetching error

func NewLoadingError

func NewLoadingError(err error) error

NewLoadingError returns new loading error

Types

type DocsMeta

type DocsMeta struct {
	Docs []internal.AddonDocs `yaml:"docs"`
}

DocsMeta contains data about addon's docs fetched from docs/meta.yaml file

func (*DocsMeta) Validate

func (m *DocsMeta) Validate() error

Validate checks the DocsMeta

type Error

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

Error holds information about the addon error

func (*Error) Error

func (e *Error) Error() string

Error returns error message

func (*Error) Kind

func (e *Error) Kind() Kind

Kind returns error kind

type FormMeta

type FormMeta struct {
	ID                  string            `yaml:"id"`
	Name                string            `yaml:"name"`
	Version             string            `yaml:"version"`
	Description         string            `yaml:"description"`
	DisplayName         string            `yaml:"displayName"`
	Tags                string            `yaml:"tags"`
	ProviderDisplayName string            `yaml:"providerDisplayName"`
	LongDescription     string            `yaml:"longDescription"`
	DocumentationURL    string            `yaml:"documentationURL"`
	SupportURL          string            `yaml:"supportURL"`
	ImageURL            string            `yaml:"imageURL"`
	Bindable            bool              `yaml:"bindable"`
	ProvisionOnlyOnce   bool              `yaml:"provisionOnlyOnce"`
	Labels              map[string]string `yaml:"labels"`
	Requires            []string          `yaml:"requires"`
	BindingsRetrievable bool              `yaml:"bindingsRetrievable"`
	PlanUpdatable       *bool             `yaml:"planUpdatable"`
}

FormMeta describes the metdata information about the addon.

func (*FormMeta) MapLabelsToModel

func (m *FormMeta) MapLabelsToModel() internal.Labels

MapLabelsToModel maps the FormMeta.Labels to the model internal.Labels

func (*FormMeta) MapTagsToModel

func (m *FormMeta) MapTagsToModel() []internal.AddonTag

MapTagsToModel maps the FormMeta.Tags to the model internal.AddonTag slice

func (*FormMeta) Validate

func (m *FormMeta) Validate() error

Validate checks the FormMeta if all required fields are set

type Kind

type Kind int

Kind represents the kind of the error

const (
	// Unknown represents unknown error about loading addon entry
	Unknown Kind = iota
	// LoadingErrorKind represents error occurred when addon
	// was successfully fetched from external repository but processing/loading phase failed
	LoadingErrorKind
	// FetchingErrorKind represents error occurred when addon cannot be fetched from external repository
	FetchingErrorKind
)

func (Kind) String

func (r Kind) String() string

String returns name of the given kind

type Loader

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

Loader provides loading of addons from repository and representing them as addons and helm3 charts.

func NewLoader

func NewLoader(tmpDir string, log logrus.FieldLogger) *Loader

NewLoader returns new instance of Loader.

func (*Loader) Load

func (l *Loader) Load(in io.Reader) (*internal.Addon, []*chart.Chart, error)

Load takes stream with compressed tgz archive as io.Reader, tries to unpack it to tmp directory, and then loads it as addon and Helm chart

func (Loader) LoadDir

func (l Loader) LoadDir(path string) (*internal.Addon, []*chart.Chart, error)

LoadDir takes uncompressed chart in specified directory and loads it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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