componentoverwrites

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RepoCtx       cdRefAspect = "RepositoryContext"
	ComponentName cdRefAspect = "ComponentName"
	Version       cdRefAspect = "Version"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentDescriptorReferenceDiff

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

ComponentDescriptorReferenceDiff represents a diff between two component descriptor references. It is meant to be used to describe the changes in a component descriptor reference which has been overwritten. It should be generated by using the ReferenceDiff function. It implements the Stringer interface and will produce a human-readable description of the changes between the two references.

func ReferenceDiff

ReferenceDiff returns a ComponentDescriptorReferenceDiff object, which contains information on which parts of a component reference have been overwritten. It can also produce a human-readable description of the diff.

func (*ComponentDescriptorReferenceDiff) GetComponentNameOverwrite

func (d *ComponentDescriptorReferenceDiff) GetComponentNameOverwrite() (string, string)

GetComponentNameOverwrite returns the old and the new component names. If not overwritten, both will be empty.

func (*ComponentDescriptorReferenceDiff) GetRepoCtxOverwrite

GetRepoCtxOverwrite returns the old and the new repository contexts. If not overwritten, both will be nil.

func (*ComponentDescriptorReferenceDiff) GetVersionOverwrite

func (d *ComponentDescriptorReferenceDiff) GetVersionOverwrite() (string, string)

GetVersionOverwrite returns the old and the new component versions. If not overwritten, both will be empty.

func (*ComponentDescriptorReferenceDiff) IsAnyOverwritten

func (d *ComponentDescriptorReferenceDiff) IsAnyOverwritten() bool

IsAnyOverwritten returns true if any part of the reference has been overwritten.

func (*ComponentDescriptorReferenceDiff) IsOverwritten

func (d *ComponentDescriptorReferenceDiff) IsOverwritten(aspect cdRefAspect) bool

IsOverwritten returns whether the given aspect of the reference has been overwritten.

func (*ComponentDescriptorReferenceDiff) OverwriteToString

func (d *ComponentDescriptorReferenceDiff) OverwriteToString(aspect cdRefAspect, textOnNotOverwritten bool) string

OverwriteToString returns a human-readable description of whether the given aspect of the component descriptor reference has been overwritten. If the second argument is true, a string describing that no overwrite happened will be returned if the aspect has not been overwritten. Otherwise, an empty string will be returned in these cases.

func (*ComponentDescriptorReferenceDiff) String

String returns a human-readable description of which parts of the component descriptor reference have been overwritten.

type Overwriter

type Overwriter interface {
	Replace(reference *lsv1alpha1.ComponentDescriptorReference) bool
}

Overwriter is a interface that implements a component reference replace method.

type Substitutions

type Substitutions struct {
	Substitutions []lsv1alpha1.ComponentVersionOverwrite
}

Substitutions handles overwrites and implements the Substitutor interface.

func (*Substitutions) Replace

Jump to

Keyboard shortcuts

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