cdutils

package
v0.107.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ComponentReferences = "componentReferences"
	Resources           = "resources"
)

path keywords

View Source
const MaxURICharLength = 2083

MaxURICharLength is teh maximum length that is supported for a uri.

View Source
const PathDelimiter = "/"
View Source
const Scheme = "cd"

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path struct {
	Keyword string
	Value   string
}

type URI

type URI struct {
	Raw      string
	Path     []Path
	Fragment string
}

URI defines a component descriptor resource selector URI

func ParseURI

func ParseURI(cdURI string) (*URI, error)

ParseURI parses a component descriptor access uri of the format: cd://<keyword>/<value>/<keyword>/<value>/...

func (*URI) AsRelativeResourceReference

func (u *URI) AsRelativeResourceReference() (*v1.ResourceReference, error)

func (*URI) Get

func (u *URI) Get(cd model.ComponentVersion, repositoryContext *types.UnstructuredTypedObject) (lsv1alpha1.ComponentDescriptorKind, interface{}, error)

Get resolves to a resource (model.Resource) or component (model.ComponentVersion) specified by the URI. It also returns the resource kind.

func (*URI) GetComponent

GetComponent resolves to the component descriptor specified by the URI. If a resource is specified, the component descriptor of the resource is returned, in combination with the reference from which it was resolved. ComponentVersionOverwrites are taken into account, but unlike the returned component, the reference is not overwritten.

func (*URI) GetResource

func (u *URI) GetResource(cd model.ComponentVersion, repositoryContext *types.UnstructuredTypedObject) (model.ComponentVersion, model.Resource, error)

GetResource resolves to a resource specified by the URI. It also returns the resource kind.

Jump to

Keyboard shortcuts

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