v2

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemIdentityName    = "name"
	SystemIdentityVersion = "version"
)
View Source
const (
	// SignaturePEMBlockType defines the type of a signature pem block.
	SignaturePEMBlockType = "SIGNATURE"

	// SignatureAlgorithmHeader defines a pem header where the signature algorithm is defined.
	SignatureAlgorithmHeader = "Signature Algorithm"

	// MediaTypePEM defines the media type for pem formatted data.
	MediaTypePEM = "application/x-pem-file"

	// MediaTypeRSASignature defines the media type for a plain RSA signature.
	MediaTypeRSASignature = "application/vnd.ocm.signature.rsa"

	// RSAPKCS1v15 defines the type for the RSA PKCS #1 v1.5 signature algorithm
	RSAPKCS1v15 = "RSASSA-PKCS1-V1_5"

	// ExcludeFromSignature used in digest field for normalisationAlgorithm (in combination with NoDigest for hashAlgorithm and value)
	// to indicate the resource content should not be part of the signature
	ExcludeFromSignature = "EXCLUDE-FROM-SIGNATURE"

	// NoDigest used in digest field for hashAlgorithm and value (in combination with ExcludeFromSignature for normalisationAlgorithm)
	// to indicate the resource content should not be part of the signature
	NoDigest = "NO-DIGEST"
)
View Source
const CosignSignatureType = "cosignSignature"

CosignSignatureType is the type of a cosign signature.

View Source
const GitHubAccessType = "github"

GitHubAccessType is the type of a git object.

View Source
const GitType = "git"

GitType is the type a git repository resource.

View Source
const LocalFilesystemBlobType = "localFilesystemBlob"

LocalFilesystemBlobType is the access type of a blob in a local filesystem.

View Source
const LocalOCIBlobType = "localOciBlob"

LocalOCIBlobType is the access type of a oci blob in the current component descriptor manifest.

View Source
const OCIBlobType = "ociBlob"

OCIBlobType is the access type of a oci blob in a manifest.

View Source
const OCIImageType = "ociImage"

OCIImageType is the type of an oci image component.

View Source
const OCIRegistryType = "ociRegistry"

OCIRegistryType is the access type of a oci registry.

View Source
const RelativeOciReferenceType = "relativeOciReference"

RelativeOciReferenceType is the access type of a relative oci reference.

View Source
const S3AccessType = "s3"

S3AccessType is the type of a s3 access.

View Source
const SchemaVersion = "v2"
View Source
const WebType = "web"

WebType is the type of a web component

Variables

DefaultJSONTypedObjectCodec implements TypedObjectCodec interface with the json decoder and json encoder.

View Source
var (
	ErrNotFound = errors.New("NotFound")
)
View Source
var KnownAccessTypes = KnownTypes{
	OCIRegistryType:          DefaultJSONTypedObjectCodec,
	OCIBlobType:              DefaultJSONTypedObjectCodec,
	RelativeOciReferenceType: DefaultJSONTypedObjectCodec,
	GitHubAccessType:         DefaultJSONTypedObjectCodec,
	WebType:                  DefaultJSONTypedObjectCodec,
	LocalFilesystemBlobType:  DefaultJSONTypedObjectCodec,
}

KnownAccessTypes contains all known access serializer

Functions

func DefaultComponent

func DefaultComponent(component *ComponentDescriptor) error

DefaultComponent applies defaults to a component

func DefaultList

func DefaultList(list *ComponentDescriptorList) error

DefaultList defaults a list of components.

func DefaultResources

func DefaultResources(component *ComponentDescriptor)

DefaultResources defaults a list of resources. The version of the component is defaulted for local resources that do not contain a version. adds the version as identity if the resource identity would clash otherwise.

func FromUnstructuredObject

func FromUnstructuredObject(codec TypedObjectCodec, uObj *UnstructuredTypedObject, obj TypedObjectAccessor) error

FromUnstructuredObject converts a unstructured object into a typed object.

func InjectRepositoryContext

func InjectRepositoryContext(cd *ComponentDescriptor, repoCtx TypedObjectAccessor) error

InjectRepositoryContext appends the given repository context to components descriptor repository history. The context is not appended if the effective repository context already matches the current context.

func MatchResourceSelectorFuncs

func MatchResourceSelectorFuncs(obj Resource, resourceSelectors ...ResourceSelectorFunc) (bool, error)

MatchResourceSelectorFuncs applies all resource selector against the given resource object.

func NewNameSelector

func NewNameSelector(name string) selector.Interface

NewNameSelector creates a new selector that matches a resource name.

func TypedObjectEqual

func TypedObjectEqual(a, b TypedObjectAccessor) bool

TypedObjectEqual compares two typed objects using the unstructured type.

func UnstructuredTypesEqual

func UnstructuredTypesEqual(a, b *UnstructuredTypedObject) bool

UnstructuredTypesEqual compares two unstructured object.

Types

type ComponentDescriptor

type ComponentDescriptor struct {
	// Metadata specifies the schema version of the component.
	Metadata Metadata `json:"meta"`
	// Spec contains the specification of the component.
	ComponentSpec `json:"component"`

	// Signatures contains a list of signatures for the ComponentDescriptor
	Signatures []Signature `json:"signatures,omitempty"`
}

ComponentDescriptor defines a versioned component with a source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*ComponentDescriptor) DeepCopy

func (in *ComponentDescriptor) DeepCopy() *ComponentDescriptor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentDescriptor.

func (*ComponentDescriptor) DeepCopyInto

func (in *ComponentDescriptor) DeepCopyInto(out *ComponentDescriptor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ComponentDescriptor) GetComponentReferenceIndex

func (c ComponentDescriptor) GetComponentReferenceIndex(ref ComponentReference) int

GetComponentReferenceIndex returns the index of a given component reference. If the index is not found -1 is returned.

func (ComponentDescriptor) GetComponentReferences

func (c ComponentDescriptor) GetComponentReferences(selectors ...IdentitySelector) ([]ComponentReference, error)

GetComponentReferences returns all component references that matches the given selectors.

func (ComponentDescriptor) GetComponentReferencesByName

func (c ComponentDescriptor) GetComponentReferencesByName(name string) ([]ComponentReference, error)

GetComponentReferencesByName returns all component references with a given name.

func (ComponentDescriptor) GetEffectiveRepositoryContext

func (c ComponentDescriptor) GetEffectiveRepositoryContext() *UnstructuredTypedObject

GetEffectiveRepositoryContext returns the current active repository context.

func (ComponentDescriptor) GetExternalResource

func (c ComponentDescriptor) GetExternalResource(rtype, name, version string) (Resource, error)

GetExternalResource returns a external resource with the given type, name and version. If multiple resources match, the first one is returned.

func (ComponentDescriptor) GetExternalResources

func (c ComponentDescriptor) GetExternalResources(rtype, name, version string) ([]Resource, error)

GetExternalResources returns a external resource with the given type, name and version.

func (ComponentDescriptor) GetLocalResource

func (c ComponentDescriptor) GetLocalResource(rtype, name, version string) (Resource, error)

GetLocalResource returns a local resource with the given type, name and version. If multiple resources match, the first one is returned.

func (ComponentDescriptor) GetLocalResources

func (c ComponentDescriptor) GetLocalResources(rtype, name, version string) ([]Resource, error)

GetLocalResources returns all local resources with the given type, name and version.

func (ComponentDescriptor) GetResourceByDefaultSelector

func (c ComponentDescriptor) GetResourceByDefaultSelector(sel interface{}) ([]Resource, error)

GetResourceByDefaultSelector returns resources that match the given selectors.

func (ComponentDescriptor) GetResourceByIdentity

func (c ComponentDescriptor) GetResourceByIdentity(id Identity) (Resource, error)

GetResourceByIdentity returns resource that match the given identity.

func (ComponentDescriptor) GetResourceByJSONScheme

func (c ComponentDescriptor) GetResourceByJSONScheme(src interface{}) ([]Resource, error)

GetResourceByJSONScheme returns resources that match the given selectors.

func (ComponentDescriptor) GetResourceByRegexSelector

func (c ComponentDescriptor) GetResourceByRegexSelector(sel interface{}) ([]Resource, error)

GetResourceByRegexSelector returns resources that match the given selectors.

func (ComponentDescriptor) GetResourceIndex

func (c ComponentDescriptor) GetResourceIndex(res Resource) int

GetResourceIndex returns the index of a given resource. If the index is not found -1 is returned.

func (ComponentDescriptor) GetResourcesByName

func (c ComponentDescriptor) GetResourcesByName(name string, selectors ...IdentitySelector) ([]Resource, error)

GetResourcesByName returns all local and external resources with a name.

func (ComponentDescriptor) GetResourcesBySelector

func (c ComponentDescriptor) GetResourcesBySelector(selectors ...IdentitySelector) ([]Resource, error)

GetResourcesBySelector returns resources that match the given selector.

func (ComponentDescriptor) GetResourcesByType

func (c ComponentDescriptor) GetResourcesByType(rtype string, selectors ...IdentitySelector) ([]Resource, error)

GetResourcesByType returns all resources that match the given type and selectors.

func (ComponentDescriptor) GetSourceIndex

func (c ComponentDescriptor) GetSourceIndex(src Source) int

GetSourceIndex returns the index of a given source. If the index is not found -1 is returned.

type ComponentDescriptorList

type ComponentDescriptorList struct {
	Metadata Metadata `json:"meta"`

	// Components contain all resolvable components with their dependencies
	Components []ComponentDescriptor `json:"components"`
}

ComponentDescriptorList describes the v2 component descriptor containing components and their versions.

func (*ComponentDescriptorList) GetComponent

func (c *ComponentDescriptorList) GetComponent(name, version string) (ComponentDescriptor, error)

GetComponent return the component with a given name and version. It returns an error if no component with the name and version is defined.

func (*ComponentDescriptorList) GetComponentByName

func (c *ComponentDescriptorList) GetComponentByName(name string) []ComponentDescriptor

GetComponentByName returns all components that match the given name.

type ComponentNameMapping

type ComponentNameMapping string

ComponentNameMapping describes the method that is used to map the "Component Name", "Component Version"-tuples to OCI Image References.

const (
	OCIRegistryURLPathMapping ComponentNameMapping = "urlPath"
	OCIRegistryDigestMapping  ComponentNameMapping = "sha256-digest"
)

type ComponentReference

type ComponentReference struct {
	// Name is the context unique name of the object.
	Name string `json:"name"`
	// ComponentName describes the remote name of the referenced object
	ComponentName string `json:"componentName"`
	// Version is the semver version of the object.
	Version string `json:"version"`
	// ExtraIdentity is the identity of an object.
	// An additional label with key "name" ist not allowed
	ExtraIdentity Identity `json:"extraIdentity,omitempty"`
	// Digest is the optional digest of the referenced component.
	// +optional
	Digest *DigestSpec `json:"digest,omitempty"`
	// Labels defines an optional set of additional labels
	// describing the object.
	// +optional
	Labels Labels `json:"labels,omitempty"`
}

ComponentReference describes the reference to another component in the registry. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*ComponentReference) DeepCopy

func (in *ComponentReference) DeepCopy() *ComponentReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentReference.

func (*ComponentReference) DeepCopyInto

func (in *ComponentReference) DeepCopyInto(out *ComponentReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentReference) GetIdentity

func (o *ComponentReference) GetIdentity() Identity

GetIdentity returns the identity of the object.

func (*ComponentReference) GetIdentityDigest

func (o *ComponentReference) GetIdentityDigest() []byte

GetIdentityDigest returns the digest of the object's identity.

func (ComponentReference) GetLabels

func (o ComponentReference) GetLabels() Labels

GetLabels returns the label of the object.

func (ComponentReference) GetName

func (o ComponentReference) GetName() string

GetName returns the name of the object.

func (ComponentReference) GetVersion

func (o ComponentReference) GetVersion() string

GetVersion returns the version of the object.

func (*ComponentReference) SetLabels

func (o *ComponentReference) SetLabels(labels []Label)

SetLabels sets the labels of the object.

func (*ComponentReference) SetName

func (o *ComponentReference) SetName(name string)

SetName sets the name of the object.

func (*ComponentReference) SetVersion

func (o *ComponentReference) SetVersion(version string)

SetVersion sets the version of the object.

type ComponentSpec

type ComponentSpec struct {
	ObjectMeta `json:",inline"`
	// RepositoryContexts defines the previous repositories of the component
	RepositoryContexts []*UnstructuredTypedObject `json:"repositoryContexts"`
	// Provider defines the provider type of a component.
	// It can be external or internal.
	Provider ProviderType `json:"provider"`
	// Sources defines sources that produced the component
	Sources []Source `json:"sources"`
	// ComponentReferences references component dependencies that can be resolved in the current context.
	ComponentReferences []ComponentReference `json:"componentReferences"`
	// Resources defines all resources that are created by the component and by a third party.
	Resources []Resource `json:"resources"`
	//CreationTime defines the datetime the component was created
	CreationTime string `json:"creationTime,omitempty"`
}

ComponentSpec defines a virtual component with a repository context, source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*ComponentSpec) DeepCopy

func (in *ComponentSpec) DeepCopy() *ComponentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentSpec.

func (*ComponentSpec) DeepCopyInto

func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DefaultJSONTypedObjectDecoder

type DefaultJSONTypedObjectDecoder struct{}

DefaultJSONTypedObjectDecoder is a simple decoder that implements the TypedObjectDecoder interface. It simply decodes the access using the json marshaller.

func (DefaultJSONTypedObjectDecoder) Decode

Decode is the Decode implementation of the TypedObjectDecoder interface.

type DefaultJSONTypedObjectEncoder

type DefaultJSONTypedObjectEncoder struct{}

DefaultJSONTypedObjectEncoder is a simple decoder that implements the TypedObjectDecoder interface. It encodes the access type using the default json marshaller.

func (DefaultJSONTypedObjectEncoder) Encode

Encode is the Encode implementation of the TypedObjectEncoder interface.

type DigestSpec

type DigestSpec struct {
	HashAlgorithm          string `json:"hashAlgorithm"`
	NormalisationAlgorithm string `json:"normalisationAlgorithm"`
	Value                  string `json:"value"`
}

DigestSpec defines a digest. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func NewExcludeFromSignatureDigest

func NewExcludeFromSignatureDigest() *DigestSpec

NewExcludeFromSignatureDigest returns the special digest notation to indicate the resource content should not be part of the signature

func (*DigestSpec) DeepCopy

func (in *DigestSpec) DeepCopy() *DigestSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DigestSpec.

func (*DigestSpec) DeepCopyInto

func (in *DigestSpec) DeepCopyInto(out *DigestSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GitHubAccess

type GitHubAccess struct {
	ObjectType `json:",inline"`

	// RepoURL is the url pointing to the remote repository.
	RepoURL string `json:"repoUrl"`
	// Ref describes the git reference.
	Ref string `json:"ref"`
	// Commit describes the git commit of the referenced repository.
	// +optional
	Commit string `json:"commit,omitempty"`
}

GitHubAccess describes a github repository resource access.

func NewGitHubAccess

func NewGitHubAccess(url, ref, commit string) *GitHubAccess

NewGitHubAccess creates a new Web accessor

func (GitHubAccess) GetType

func (a GitHubAccess) GetType() string

type Identity

type Identity map[string]string

Identity describes the identity of an object. Only ascii characters are allowed +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (Identity) DeepCopy

func (in Identity) DeepCopy() Identity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity.

func (Identity) DeepCopyInto

func (in Identity) DeepCopyInto(out *Identity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Identity) Digest

func (i Identity) Digest() []byte

Digest returns the object digest of an identity

func (Identity) Match

func (i Identity) Match(obj map[string]string) (bool, error)

Match implements the selector interface.

type IdentityObjectMeta

type IdentityObjectMeta struct {
	// Name is the context unique name of the object.
	Name string `json:"name"`
	// Version is the semver version of the object.
	Version string `json:"version"`
	// Type describes the type of the object.
	Type string `json:"type"`
	// ExtraIdentity is the identity of an object.
	// An additional label with key "name" ist not allowed
	ExtraIdentity Identity `json:"extraIdentity,omitempty"`
	// Labels defines an optional set of additional labels
	// describing the object.
	// +optional
	Labels Labels `json:"labels,omitempty"`
}

IdentityObjectMeta defines a object that is uniquely identified by its identity. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*IdentityObjectMeta) DeepCopy

func (in *IdentityObjectMeta) DeepCopy() *IdentityObjectMeta

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityObjectMeta.

func (*IdentityObjectMeta) DeepCopyInto

func (in *IdentityObjectMeta) DeepCopyInto(out *IdentityObjectMeta)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IdentityObjectMeta) GetIdentity

func (o *IdentityObjectMeta) GetIdentity() Identity

GetIdentity returns the identity of the object.

func (*IdentityObjectMeta) GetIdentityDigest

func (o *IdentityObjectMeta) GetIdentityDigest() []byte

GetIdentityDigest returns the digest of the object's identity.

func (IdentityObjectMeta) GetLabels

func (o IdentityObjectMeta) GetLabels() Labels

GetLabels returns the label of the object.

func (IdentityObjectMeta) GetName

func (o IdentityObjectMeta) GetName() string

GetName returns the name of the object.

func (IdentityObjectMeta) GetType

func (o IdentityObjectMeta) GetType() string

GetType returns the type of the object.

func (IdentityObjectMeta) GetVersion

func (o IdentityObjectMeta) GetVersion() string

GetVersion returns the version of the object.

func (*IdentityObjectMeta) SetExtraIdentity

func (o *IdentityObjectMeta) SetExtraIdentity(identity Identity)

SetExtraIdentity sets the identity of the object.

func (*IdentityObjectMeta) SetLabels

func (o *IdentityObjectMeta) SetLabels(labels []Label)

SetLabels sets the labels of the object.

func (*IdentityObjectMeta) SetName

func (o *IdentityObjectMeta) SetName(name string)

SetName sets the name of the object.

func (*IdentityObjectMeta) SetType

func (o *IdentityObjectMeta) SetType(ttype string)

SetType sets the type of the object.

func (*IdentityObjectMeta) SetVersion

func (o *IdentityObjectMeta) SetVersion(version string)

SetVersion sets the version of the object.

type IdentitySelector

type IdentitySelector = selector.Interface

type KnownTypeValidationFunc

type KnownTypeValidationFunc func(ttype string) error

KnownTypeValidationFunc defines a function that can validate types.

type KnownTypes

type KnownTypes map[string]TypedObjectCodec

KnownTypes defines a set of known types.

func (*KnownTypes) Register

func (kt *KnownTypes) Register(ttype string, codec TypedObjectCodec) (overwritten bool)

Register adds a codec for a specific type to the list of known types. It returns if the operation has overwritten an already registered type.

type Label

type Label struct {
	// Name is the unique name of the label.
	Name string `json:"name"`
	// Value is the json/yaml data of the label
	Value json.RawMessage `json:"value"`
}

Label is a label that can be set on objects. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*Label) DeepCopy

func (in *Label) DeepCopy() *Label

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Label.

func (*Label) DeepCopyInto

func (in *Label) DeepCopyInto(out *Label)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Labels

type Labels []Label

Labels describe a list of labels +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (Labels) DeepCopy

func (in Labels) DeepCopy() Labels

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Labels.

func (Labels) DeepCopyInto

func (in Labels) DeepCopyInto(out *Labels)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Labels) Get

func (l Labels) Get(name string) ([]byte, bool)

Get returns the label witht the given name

type LabelsAccessor

type LabelsAccessor interface {
	// GetLabels returns the labels of the object.
	GetLabels() Labels
	// SetLabels sets the labels of the object.
	SetLabels(labels []Label)
}

LabelsAccessor describes a accessor for a labeled object.

type LocalFilesystemBlobAccess

type LocalFilesystemBlobAccess struct {
	ObjectType `json:",inline"`
	// Filename is the name of the blob in the local filesystem.
	// The blob is expected to be at <fs-root>/blobs/<name>
	Filename string `json:"filename"`
	// MediaType is the media type of the object this filename refers to.
	MediaType string `json:"mediaType,omitempty"`
}

LocalFilesystemBlobAccess describes the access for a blob on the filesystem.

func NewLocalFilesystemBlobAccess

func NewLocalFilesystemBlobAccess(path string, mediaType string) *LocalFilesystemBlobAccess

NewLocalFilesystemBlobAccess creates a new localFilesystemBlob accessor.

func (*LocalFilesystemBlobAccess) GetType

func (*LocalFilesystemBlobAccess) GetType() string

type LocalOCIBlobAccess

type LocalOCIBlobAccess struct {
	ObjectType `json:",inline"`
	// Digest is the digest of the targeted content.
	Digest string `json:"digest"`
}

LocalOCIBlobAccess describes the access for a blob that is stored in the component descriptors oci manifest.

func NewLocalOCIBlobAccess

func NewLocalOCIBlobAccess(digest string) *LocalOCIBlobAccess

NewLocalOCIBlobAccess creates a new LocalOCIBlob accessor

func (*LocalOCIBlobAccess) GetType

func (*LocalOCIBlobAccess) GetType() string

type Metadata

type Metadata struct {
	// Version is the schema version of the component descriptor.
	Version string `json:"schemaVersion"`
}

Metadata defines the metadata of the component descriptor. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NameAccessor

type NameAccessor interface {
	// GetName returns the name of the object.
	GetName() string
	// SetName sets the name of the object.
	SetName(name string)
}

NameAccessor describes a accessor for a named object.

type NormalisationAlgorithm

type NormalisationAlgorithm string

NormalisationAlgorithm types and versions the algorithm used for digest generation.

const (
	JsonNormalisationV1 NormalisationAlgorithm = "jsonNormalisation/v1"
	OciArtifactDigestV1 NormalisationAlgorithm = "ociArtifactDigest/v1"
	GenericBlobDigestV1 NormalisationAlgorithm = "genericBlobDigest/v1"
)

type OCIBlobAccess

type OCIBlobAccess struct {
	ObjectType `json:",inline"`

	// Reference is the oci reference to the manifest
	Reference string `json:"ref"`

	// MediaType is the media type of the object this schema refers to.
	MediaType string `json:"mediaType,omitempty"`

	// Digest is the digest of the targeted content.
	Digest string `json:"digest"`

	// Size specifies the size in bytes of the blob.
	Size int64 `json:"size"`
}

OCIBlobAccess describes the access for a oci registry.

func NewOCIBlobAccess

func NewOCIBlobAccess(ref, mediaType, digest string, size int64) *OCIBlobAccess

NewOCIBlobAccess creates a new OCIBlob accessor

func (*OCIBlobAccess) GetType

func (*OCIBlobAccess) GetType() string

type OCIRegistryAccess

type OCIRegistryAccess struct {
	ObjectType `json:",inline"`

	// ImageReference is the actual reference to the oci image repository and tag.
	ImageReference string `json:"imageReference"`
}

OCIRegistryAccess describes the access for a oci registry.

func NewOCIRegistryAccess

func NewOCIRegistryAccess(ref string) *OCIRegistryAccess

NewOCIRegistryAccess creates a new OCIRegistryAccess accessor

func (*OCIRegistryAccess) GetType

func (a *OCIRegistryAccess) GetType() string

type OCIRegistryRepository

type OCIRegistryRepository struct {
	ObjectType `json:",inline"`
	// BaseURL is the base url of the repository to resolve components.
	BaseURL string `json:"baseUrl"`
	// ComponentNameMapping describes the method that is used to map the "Component Name", "Component Version"-tuples
	// to OCI Image References.
	ComponentNameMapping ComponentNameMapping `json:"componentNameMapping"`
}

OCIRegistryRepository describes a component repository backed by a oci registry.

func NewOCIRegistryRepository

func NewOCIRegistryRepository(baseURL string, mapping ComponentNameMapping) *OCIRegistryRepository

NewOCIRegistryRepository creates a new OCIRegistryRepository accessor

func (*OCIRegistryRepository) GetType

func (a *OCIRegistryRepository) GetType() string

type ObjectMeta

type ObjectMeta struct {
	// Name is the context unique name of the object.
	Name string `json:"name"`
	// Version is the semver version of the object.
	Version string `json:"version"`
	// Labels defines an optional set of additional labels
	// describing the object.
	// +optional
	Labels Labels `json:"labels,omitempty"`
}

ObjectMeta defines a object that is uniquely identified by its name and version. +k8s:deepcopy-gen=true

func (*ObjectMeta) DeepCopy

func (in *ObjectMeta) DeepCopy() *ObjectMeta

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta.

func (*ObjectMeta) DeepCopyInto

func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ObjectMeta) GetLabels

func (o ObjectMeta) GetLabels() Labels

GetLabels returns the label of the object.

func (ObjectMeta) GetName

func (o ObjectMeta) GetName() string

GetName returns the name of the object.

func (ObjectMeta) GetVersion

func (o ObjectMeta) GetVersion() string

GetVersion returns the version of the object.

func (*ObjectMeta) SetLabels

func (o *ObjectMeta) SetLabels(labels []Label)

SetLabels sets the labels of the object.

func (*ObjectMeta) SetName

func (o *ObjectMeta) SetName(name string)

SetName sets the name of the object.

func (*ObjectMeta) SetVersion

func (o *ObjectMeta) SetVersion(version string)

SetVersion sets the version of the object.

type ObjectMetaAccessor

type ObjectMetaAccessor interface {
	NameAccessor
	VersionAccessor
	LabelsAccessor
}

ObjectMetaAccessor describes a accessor for named and versioned object.

type ObjectType

type ObjectType struct {
	// Type describes the type of the object.
	Type string `json:"type"`
}

ObjectType describes the type of a object +k8s:deepcopy-gen=true

func (*ObjectType) DeepCopy

func (in *ObjectType) DeepCopy() *ObjectType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectType.

func (*ObjectType) DeepCopyInto

func (in *ObjectType) DeepCopyInto(out *ObjectType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ObjectType) GetType

func (t ObjectType) GetType() string

GetType returns the type of the object.

func (*ObjectType) SetType

func (t *ObjectType) SetType(ttype string)

SetType sets the type of the object.

type ProviderType

type ProviderType string

ProviderType describes the provider of component in the origin's context. For example the name of an organisation or company. +k8s:deepcopy-gen=false +k8s:openapi-gen=true

type RelativeOciAccess

type RelativeOciAccess struct {
	ObjectType `json:",inline"`

	// Reference is the relative reference to the oci image repository and tag.
	Reference string `json:"reference"`
}

RelativeOciAccess describes the access for a relative oci reference.

func NewRelativeOciAccess

func NewRelativeOciAccess(ref string) *RelativeOciAccess

NewRelativeOciAccess creates a new RelativeOciAccess accessor

func (*RelativeOciAccess) GetType

func (*RelativeOciAccess) GetType() string

type Repository

type Repository TypedObjectAccessor

Repository is a specific type that indicated a typed repository object.

type Resource

type Resource struct {
	IdentityObjectMeta `json:",inline"`

	// Digest is the optional digest of the referenced resource.
	// +optional
	Digest *DigestSpec `json:"digest,omitempty"`

	// Relation describes the relation of the resource to the component.
	// Can be a local or external resource
	Relation ResourceRelation `json:"relation,omitempty"`

	// SourceRef defines a list of source names.
	// These names reference the sources defines in `component.sources`.
	SourceRef []SourceRef `json:"srcRef,omitempty"`

	// Access describes the type specific method to
	// access the defined resource.
	Access *UnstructuredTypedObject `json:"access"`
}

Resource describes a resource dependency of a component. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*Resource) DeepCopy

func (in *Resource) DeepCopy() *Resource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceRelation

type ResourceRelation string

ResourceRelation describes the type of a resource. Defines whether the component is created by a third party or internally. +k8s:deepcopy-gen=false +k8s:openapi-gen=true

const (
	// LocalRelation defines a internal relation
	// which describes a internally maintained resource in the origin's context.
	LocalRelation ResourceRelation = "local"
	// ExternalRelation defines a external relation
	// which describes a resource maintained by a third party vendor in the origin's context.
	ExternalRelation ResourceRelation = "external"
)

type ResourceSelectorFunc

type ResourceSelectorFunc = func(obj Resource) (bool, error)

ResourceSelectorFunc defines a function to filter a resource.

func NewRelationResourceSelector

func NewRelationResourceSelector(relation ResourceRelation) ResourceSelectorFunc

NewRelationResourceSelector creates a new resource selector that selects a resource based on its relation type.

func NewTypeResourceSelector

func NewTypeResourceSelector(ttype string) ResourceSelectorFunc

NewTypeResourceSelector creates a new resource selector that selects a resource based on its type.

func NewVersionResourceSelector

func NewVersionResourceSelector(version string) ResourceSelectorFunc

NewVersionResourceSelector creates a new resource selector that selects a resource based on its version.

type S3Access

type S3Access struct {
	ObjectType `json:",inline"`

	// BucketName is the name of the s3 bucket.
	BucketName string `json:"bucketName"`
	// ObjectKey describes the referenced object.
	ObjectKey string `json:"objectKey"`
}

S3AccessType describes a s3 resource access.

func NewS3Access

func NewS3Access(bucketName, objectKey string) *S3Access

NewS3Access creates a new s3 accessor

func (S3Access) GetType

func (a S3Access) GetType() string

type Signature

type Signature struct {
	Name      string        `json:"name"`
	Digest    DigestSpec    `json:"digest"`
	Signature SignatureSpec `json:"signature"`
}

Signature defines a digest and corresponding signature, identifyable by name. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*Signature) DeepCopy

func (in *Signature) DeepCopy() *Signature

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Signature.

func (*Signature) DeepCopyInto

func (in *Signature) DeepCopyInto(out *Signature)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SignatureSpec

type SignatureSpec struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
	MediaType string `json:"mediaType"`
}

SignatureSpec defines a signature. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*SignatureSpec) DeepCopy

func (in *SignatureSpec) DeepCopy() *SignatureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SignatureSpec.

func (*SignatureSpec) DeepCopyInto

func (in *SignatureSpec) DeepCopyInto(out *SignatureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Source

type Source struct {
	IdentityObjectMeta `json:",inline"`
	Access             *UnstructuredTypedObject `json:"access"`
}

Source is the definition of a component's source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*Source) DeepCopy

func (in *Source) DeepCopy() *Source

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source.

func (*Source) DeepCopyInto

func (in *Source) DeepCopyInto(out *Source)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SourceRef

type SourceRef struct {
	// IdentitySelector defines the identity that is used to match a source.
	IdentitySelector map[string]string `json:"identitySelector,omitempty"`
	// Labels defines an optional set of additional labels
	// describing the object.
	// +optional
	Labels Labels `json:"labels,omitempty"`
}

SourceRef defines a reference to a source +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*SourceRef) DeepCopy

func (in *SourceRef) DeepCopy() *SourceRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRef.

func (*SourceRef) DeepCopyInto

func (in *SourceRef) DeepCopyInto(out *SourceRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TypedObjectAccessor

type TypedObjectAccessor interface {
	// GetType returns the type of the access object.
	GetType() string
	// SetType sets the type of the access object.
	SetType(ttype string)
}

TypedObjectAccessor defines the accessor for a typed component with additional data.

type TypedObjectCodec

type TypedObjectCodec interface {
	TypedObjectDecoder
	TypedObjectEncoder
}

TypedObjectCodec describes a known component type and how it is decoded and encoded

func NewCodec

func NewCodec(knownTypes KnownTypes, defaultCodec TypedObjectCodec, validationFunc KnownTypeValidationFunc) TypedObjectCodec

NewCodec creates a new typed object codec.

func NewDefaultCodec

func NewDefaultCodec() TypedObjectCodec

NewDefaultCodec creates a new default typed object codec.

type TypedObjectCodecWrapper

type TypedObjectCodecWrapper struct {
	TypedObjectDecoder
	TypedObjectEncoder
}

TypedObjectCodecWrapper is a simple struct that implements the TypedObjectCodec interface

type TypedObjectDecoder

type TypedObjectDecoder interface {
	Decode(data []byte, into TypedObjectAccessor) error
}

TypedObjectDecoder defines a decoder for a typed object.

type TypedObjectDecoderFunc

type TypedObjectDecoderFunc func(data []byte, obj TypedObjectAccessor) error

TypedObjectDecoderFunc is a simple function that implements the TypedObjectDecoder interface.

func (TypedObjectDecoderFunc) Decode

func (e TypedObjectDecoderFunc) Decode(data []byte, obj TypedObjectAccessor) error

Decode is the Decode implementation of the TypedObjectDecoder interface.

type TypedObjectEncoder

type TypedObjectEncoder interface {
	Encode(accessor TypedObjectAccessor) ([]byte, error)
}

TypedObjectEncoder defines a encoder for a typed object.

type TypedObjectEncoderFunc

type TypedObjectEncoderFunc func(accessor TypedObjectAccessor) ([]byte, error)

TypedObjectEncoderFunc is a simple function that implements the TypedObjectEncoder interface.

func (TypedObjectEncoderFunc) Encode

func (e TypedObjectEncoderFunc) Encode(accessor TypedObjectAccessor) ([]byte, error)

Encode is the Encode implementation of the TypedObjectEncoder interface.

type UnstructuredTypedObject

type UnstructuredTypedObject struct {
	ObjectType `json:",inline"`
	Raw        []byte                 `json:"-"`
	Object     map[string]interface{} `json:"-"`
}

UnstructuredTypedObject describes a generic typed object. +k8s:openapi-gen=true

func NewEmptyUnstructured

func NewEmptyUnstructured(ttype string) *UnstructuredTypedObject

NewEmptyUnstructured creates a new typed object without additional data.

func NewUnstructured

func NewUnstructured(obj TypedObjectAccessor) (UnstructuredTypedObject, error)

NewUnstructured creates a new unstructured object from a typed object using the default codec.

func NewUnstructuredType

func NewUnstructuredType(ttype string, data map[string]interface{}) *UnstructuredTypedObject

NewUnstructuredType creates a new unstructured typed object.

func ToUnstructuredTypedObject

func ToUnstructuredTypedObject(codec TypedObjectCodec, obj TypedObjectAccessor) (*UnstructuredTypedObject, error)

ToUnstructuredTypedObject converts a typed object to a unstructured object.

func (*UnstructuredTypedObject) DecodeInto

DecodeInto decodes a unstructured typed object into a TypedObjectAccessor using the default codec

func (*UnstructuredTypedObject) DeepCopy

DeepCopy is deepcopy function, copying the receiver, creating a new UnstructuredTypedObject.

func (*UnstructuredTypedObject) DeepCopyInto

func (u *UnstructuredTypedObject) DeepCopyInto(out *UnstructuredTypedObject)

DeepCopyInto is deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (UnstructuredTypedObject) GetRaw

func (u UnstructuredTypedObject) GetRaw() ([]byte, error)

func (*UnstructuredTypedObject) MarshalJSON

func (u *UnstructuredTypedObject) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom json unmarshal method for a unstructured type.

func (UnstructuredTypedObject) OpenAPISchemaFormat

func (UnstructuredTypedObject) OpenAPISchemaFormat() string

func (UnstructuredTypedObject) OpenAPISchemaType

func (UnstructuredTypedObject) OpenAPISchemaType() []string

func (*UnstructuredTypedObject) SetType

func (u *UnstructuredTypedObject) SetType(ttype string)

func (*UnstructuredTypedObject) UnmarshalJSON

func (u *UnstructuredTypedObject) UnmarshalJSON(data []byte) error

UnmarshalJSON implements a custom json unmarshal method for a unstructured typed object.

type VersionAccessor

type VersionAccessor interface {
	// GetVersion returns the version of the object.
	GetVersion() string
	// SetVersion sets the version of the object.
	SetVersion(version string)
}

VersionAccessor describes a accessor for a versioned object.

type Web

type Web struct {
	ObjectType `json:",inline"`

	// URL is the http get accessible url resource.
	URL string `json:"url"`
}

Web describes a web resource access that can be fetched via http GET request.

func NewWebAccess

func NewWebAccess(url string) *Web

NewWebAccess creates a new Web accessor

func (*Web) GetType

func (*Web) GetType() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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