repository

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Repositories []*Repository
}

Collection keeps and process collection of Repository

func NewRepositoryCollection

func NewRepositoryCollection() *Collection

NewRepositoryCollection returns pointer to RepositoryCollection

func (*Collection) AddRepository

func (rc *Collection) AddRepository(repo *Repository)

AddRepository adds new Repository to RepositoryCollection

func (*Collection) IsRepositoriesFailed

func (rc *Collection) IsRepositoriesFailed() bool

IsRepositoriesFailed informs if any of repositories in collection is in failed status

func (*Collection) ReadyAddons

func (rc *Collection) ReadyAddons() []*Entry

ReadyAddons returns all addons from all repositories which ready status

func (*Collection) ReviseAddonDuplicationInRepository

func (rc *Collection) ReviseAddonDuplicationInRepository()

ReviseAddonDuplicationInRepository checks all completed addons (addons without fetch/load error) they have no ID conflict with other addons in other or the same repository

func (*Collection) ReviseAddonDuplicationInStorage

func (rc *Collection) ReviseAddonDuplicationInStorage(addonsList []internal.CommonAddon)

ReviseAddonDuplicationInStorage checks all completed addons (addons without fetch/load error) they have no name:version conflict with other AddonConfiguration

type Entry

type Entry struct {
	ID  string
	URL string

	AddonWithCharts *internal.AddonWithCharts
}

Entry is a wraper for AddonWithCharts element with extra fields like URL or ID

func NewRepositoryEntry

func NewRepositoryEntry(n, v, u string) *Entry

NewRepositoryEntry returns pointer to new Entry based on name, version and url

func (*Entry) ConflictInSpecifiedRepositories

func (a *Entry) ConflictInSpecifiedRepositories(err error)

ConflictInSpecifiedRepositories sets addons as failed, sets addon reason as ConflictInSpecifiedRepositories

func (*Entry) ConflictWithAlreadyRegisteredAddons

func (a *Entry) ConflictWithAlreadyRegisteredAddons(err error)

ConflictWithAlreadyRegisteredAddons sets addons as failed, sets addon reason as ConflictWithAlreadyRegisteredAddons

func (*Entry) FetchingError

func (a *Entry) FetchingError(err error)

FetchingError sets addons as failed, sets addon reason as FetchingError

func (*Entry) IsComplete

func (a *Entry) IsComplete() bool

IsComplete informs RepositoryEntry has no fetching/loading error, what means own ID (from addon)

func (*Entry) IsReady

func (a *Entry) IsReady() bool

IsReady informs addon is in ready status

func (*Entry) LoadingError

func (a *Entry) LoadingError(err error)

LoadingError sets addons as failed, sets addon reason as LoadingError

func (*Entry) RegisteringError

func (a *Entry) RegisteringError(err error)

RegisteringError sets addons as failed, sets addon reason as RegisteringError

type Repository

type Repository struct {
	Repository addonsv1alpha1.StatusRepository
	Addons     []*Entry
}

Repository is a wraper for StatusRepository

func NewAddonsRepository

func NewAddonsRepository(url string) *Repository

NewAddonsRepository returns pointer to new Repository with url and ready status

func (*Repository) Failed

func (ar *Repository) Failed()

Failed sets StatusRepository as failed

func (*Repository) FetchingError

func (ar *Repository) FetchingError(err error)

FetchingError sets StatusRepository as failed with URLFetchingError as a reason

func (*Repository) HasFailedAddons

func (ar *Repository) HasFailedAddons() bool

HasFailedAddons returns true if any addon in the repository has status Failed

func (*Repository) IsFailed

func (ar *Repository) IsFailed() bool

IsFailed checks is StatusRepository is in failed state

func (*Repository) TemplatingError

func (ar *Repository) TemplatingError(err error)

TemplatingError sets StatusRepository as failed with URLTemplatingError as a reason

type Template

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

Template contains URL templating from secret logic

func NewTemplate

func NewTemplate(cli client.Client) *Template

NewTemplate returns a new Template service

func (*Template) SetNamespace

func (t *Template) SetNamespace(namespace string)

SetNamespace sets service's working namespace

func (*Template) TemplateURL

func (t *Template) TemplateURL(repository v1alpha1.SpecRepository) (string, error)

TemplateURL returns an URL to the repository with filled template fields

Jump to

Keyboard shortcuts

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