elements

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package elements contains builders for elements of a component version, aka resources, sources and references. The package itself contains builders for resource/source metadata and component references.

The sub package artifactblob contains packages for building technology specific blob resources/sources. When added to a component version they result in local blobs.

The sub package artifactaccess contains packages for building technology specific access specification based referential resources/sources. When added to a component version they result in external access specifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reference

func Reference(name, comp, vers string, opts ...ReferenceOption) (*compdesc.ComponentReference, error)

func ResourceMeta

func ResourceMeta(name, typ string, opts ...ResourceMetaOption) (*compdesc.ResourceMeta, error)

func SourceMeta

func SourceMeta(name, typ string, opts ...SourceMetaOption) (*compdesc.SourceMeta, error)

func WithSourceRef

func WithSourceRef(sel ...string) *srcref

WithSourceRef adds a source reference to a resource meta object. this is a sequence of name/value pairs. Optionally, additional labels can be added with srcref.WithLabel.

Types

type ArtifactOption

type ArtifactOption interface {
	ResourceMetaOption
	SourceMetaOption
}

type CommonOption

type CommonOption interface {
	ResourceMetaOption
	SourceMetaOption
	ReferenceOption
}

func WithExtraIdentity

func WithExtraIdentity(extras ...string) CommonOption

WithExtraIdentity adds extra identity properties.

func WithLabel

func WithLabel(name string, value interface{}, opts ...metav1.LabelOption) CommonOption

func WithVersion

func WithVersion(v string) CommonOption

WithVersion sets the version of the element.

type ReferenceOption

type ReferenceOption interface {
	ApplyToReference(reference *compdesc.ComponentReference) error
}

type ResourceMetaOption

type ResourceMetaOption interface {
	ApplyToResourceMeta(*compdesc.ResourceMeta) error
}

func WithExternalRelation

func WithExternalRelation(flag ...bool) ResourceMetaOption

WithExternalRelation sets the resource relation to metav1.ExternalRelation.

func WithLocalRelation

func WithLocalRelation(flag ...bool) ResourceMetaOption

WithLocalRelation sets the resource relation to metav1.LocalRelation.

type ResourceReferenceOption

type ResourceReferenceOption interface {
	ResourceMetaOption
	ReferenceOption
}

func WithDigest

func WithDigest(algo, norm, value string) ResourceReferenceOption

WithDigest sets digest information. at least one value should be set.

type SourceMetaOption

type SourceMetaOption interface {
	ApplyToSourceMeta(*compdesc.SourceMeta) error
}

Directories

Path Synopsis
Package artifactaccess hosts packages for ResourceAccess and SourceAccess builders used to add resources and sources referring to content in other repositories using access specification to a component version.
Package artifactaccess hosts packages for ResourceAccess and SourceAccess builders used to add resources and sources referring to content in other repositories using access specification to a component version.
Package artifactblob hosts packages for ResourceAccess and SourceAccess builders used to add resources and sources as local blobs to a component version.
Package artifactblob hosts packages for ResourceAccess and SourceAccess builders used to add resources and sources as local blobs to a component version.
api
externalblob
Package ociartifact provides a way to provide ResourceAccess and SourceAccess objects based on external access specification intended to be added as local access.
Package ociartifact provides a way to provide ResourceAccess and SourceAccess objects based on external access specification intended to be added as local access.

Jump to

Keyboard shortcuts

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