Documentation ¶
Index ¶
- Constants
- Variables
- func CatchConversionError(errp *error)
- func DefaultResources(component *ComponentDescriptor)
- func Encode(obj *ComponentDescriptor, opts ...EncodeOption) ([]byte, error)
- func Hash(cd *ComponentDescriptor, normAlgo string, hash hash.Hash) (string, error)
- func MatchResourceSelectorFuncs(obj Resource, resourceSelectors ...ResourceSelectorFunc) (bool, error)
- func NewNameSelector(name string) selector.Interface
- func Normalize(cd *ComponentDescriptor, normAlgo string) ([]byte, error)
- func RegisterScheme(scheme Scheme)
- func Sign(cd *ComponentDescriptor, privateKey interface{}, signer signing.Signer, ...) error
- func ThrowConversionError(err error)
- func Validate(desc *ComponentDescriptor) error
- func Verify(cd *ComponentDescriptor, registry signing.Registry, signatureName string) error
- type AccessSpec
- type Codec
- type CodecWrapper
- type ComponentDescriptor
- func (cd *ComponentDescriptor) AddRepositoryContext(repoCtx runtime.TypedObject) error
- func (cd *ComponentDescriptor) Copy() *ComponentDescriptor
- func (cd *ComponentDescriptor) GetComponentReferenceByIdentity(id v1.Identity) (ComponentReference, error)
- func (cd *ComponentDescriptor) GetComponentReferenceIndex(ref ComponentReference) int
- func (cd *ComponentDescriptor) GetComponentReferences(selectors ...IdentitySelector) ([]ComponentReference, error)
- func (cd *ComponentDescriptor) GetComponentReferencesByName(name string) []ComponentReference
- func (cd *ComponentDescriptor) GetEffectiveRepositoryContext() *runtime.UnstructuredTypedObject
- func (cd *ComponentDescriptor) GetExternalResource(rtype, name, version string) (Resource, error)
- func (cd *ComponentDescriptor) GetExternalResources(rtype, name, version string) ([]Resource, error)
- func (cd *ComponentDescriptor) GetLocalResource(rtype, name, version string) (Resource, error)
- func (cd *ComponentDescriptor) GetLocalResources(rtype, name, version string) ([]Resource, error)
- func (cd *ComponentDescriptor) GetReferenceByIdentity(id v1.Identity) (ComponentReference, error)
- func (cd *ComponentDescriptor) GetReferenceIndex(src *ElementMeta) int
- func (cd *ComponentDescriptor) GetResourceByDefaultSelector(sel interface{}) ([]Resource, error)
- func (cd *ComponentDescriptor) GetResourceByIdentity(id v1.Identity) (Resource, error)
- func (cd *ComponentDescriptor) GetResourceByJSONScheme(src interface{}) ([]Resource, error)
- func (cd *ComponentDescriptor) GetResourceByRegexSelector(sel interface{}) ([]Resource, error)
- func (cd *ComponentDescriptor) GetResourceIndex(res *ResourceMeta) int
- func (cd *ComponentDescriptor) GetResourcesByName(name string, selectors ...IdentitySelector) ([]Resource, error)
- func (cd *ComponentDescriptor) GetResourcesBySelector(selectors ...IdentitySelector) ([]Resource, error)
- func (cd *ComponentDescriptor) GetResourcesByType(rtype string, selectors ...IdentitySelector) ([]Resource, error)
- func (cd *ComponentDescriptor) GetSignatureIndex(name string) int
- func (cd *ComponentDescriptor) GetSourceByIdentity(id v1.Identity) (Source, error)
- func (cd *ComponentDescriptor) GetSourceIndex(src *SourceMeta) int
- func (cd *ComponentDescriptor) IsNormalizeable() error
- func (cd *ComponentDescriptor) Reset()
- func (cd *ComponentDescriptor) SchemaVersion() string
- func (cd *ComponentDescriptor) SelectSignatureByName(signatureName string) *metav1.Signature
- type ComponentDescriptorVersion
- type ComponentReference
- type ComponentSpec
- type DecodeOption
- type DecodeOptions
- type Decoder
- type DecoderFunc
- type DisableValidation
- type ElementAccessor
- type ElementMeta
- func (o *ElementMeta) Copy() *ElementMeta
- func (o *ElementMeta) GetIdentity(accessor ElementAccessor) metav1.Identity
- func (o *ElementMeta) GetIdentityDigest(accessor ElementAccessor) []byte
- func (o *ElementMeta) GetLabels() metav1.Labels
- func (o *ElementMeta) GetMatchBaseIdentity() metav1.Identity
- func (o *ElementMeta) GetName() string
- func (o *ElementMeta) GetVersion() string
- func (o *ElementMeta) RemoveLabel(name string) bool
- func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
- func (o *ElementMeta) SetLabel(name string, value interface{}) error
- func (o *ElementMeta) SetLabels(labels []metav1.Label)
- func (o *ElementMeta) SetName(name string)
- func (o *ElementMeta) SetVersion(version string)
- type ElementMetaAccessor
- type EncodeOption
- type EncodeOptions
- type Encoder
- type EncoderFunc
- type IdentitySelector
- type LabelsAccessor
- type Metadata
- type NameAccessor
- type NormalisationAlgorithm
- type Normalization
- type NormalizationAlgorithms
- type ObjectMeta
- type ObjectMetaAccessor
- type Provider
- type References
- type Resource
- type ResourceMeta
- type ResourceSelectorFunc
- type Resources
- type SchemaVersion
- type Scheme
- type Schemes
- type Source
- type SourceMeta
- type SourceRef
- type SourceRefs
- type Sources
- type StrictDecoder
- type StrictDecoderFunc
- type StrictMode
- type VersionAccessor
Constants ¶
const ( SystemIdentityName = "name" SystemIdentityVersion = "version" )
const ( KIND_HASH_ALGORITHM = "hash algorithm" KIND_SIGN_ALGORITHM = "signing algorithm" KIND_NORM_ALGORITHM = "normalization algorithm" KIND_VERIFY_ALGORITHM = "signature verification algorithm" KIND_PUBLIC_KEY = "public key" KIND_PRIVATE_KEY = "private key" KIND_SIGNATURE = "signature" )
const ComponentDescriptorFileName = "component-descriptor.yaml"
const DefaultSchemeVersion = "v2"
Variables ¶
var DefaultJSONLCodec = CodecWrapper{ Decoder: DecoderFunc(json.Unmarshal), StrictDecoder: StrictDecoderFunc(json.Unmarshal), Encoder: EncoderFunc(json.Marshal), }
DefaultJSONCodec implements Codec interface with the json decoder encoder.
var DefaultSchemes = Schemes{}
var DefaultYAMLCodec = CodecWrapper{ Decoder: DecoderFunc(func(data []byte, obj interface{}) error { return yaml.Unmarshal(data, obj) }), StrictDecoder: StrictDecoderFunc(func(data []byte, obj interface{}) error { return yaml.UnmarshalStrict(data, obj) }), Encoder: EncoderFunc(yaml.Marshal), }
DefaultYAMLCodec implements Codec interface with the yaml decoder encoder.
var Normalizations = NormalizationAlgorithms{/* contains filtered or unexported fields */}
var NotFound = errors.ErrNotFound()
Functions ¶
func CatchConversionError ¶
func CatchConversionError(errp *error)
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 Encode ¶
func Encode(obj *ComponentDescriptor, opts ...EncodeOption) ([]byte, error)
Encode encodes a component into the given object. The obj is expected to be of type v2.ComponentDescriptor or v2.ComponentDescriptorList. If the serialization version is left blank, the schema version configured in the component descriptor will be used.
func Hash ¶
Hash return the hash for the component-descriptor, if it is normalizeable (= componentReferences and resources contain digest field).
func MatchResourceSelectorFuncs ¶
func MatchResourceSelectorFuncs(obj Resource, resourceSelectors ...ResourceSelectorFunc) (bool, error)
MatchResourceSelectorFuncs applies all resource selector against the given resource object.
func NewNameSelector ¶
NewNameSelector creates a new selector that matches a resource name.
func RegisterScheme ¶
func RegisterScheme(scheme Scheme)
func Sign ¶
func Sign(cd *ComponentDescriptor, privateKey interface{}, signer signing.Signer, hasher signing.Hasher, signatureName, issuer string) error
Sign signs the given component-descriptor with the signer. The component-descriptor has to contain digests for componentReferences and resources.
func ThrowConversionError ¶
func ThrowConversionError(err error)
func Validate ¶
func Validate(desc *ComponentDescriptor) error
func Verify ¶
func Verify(cd *ComponentDescriptor, registry signing.Registry, signatureName string) error
Verify verifies the signature (selected by signatureName) and hash of the component-descriptor (as specified in the signature). Does NOT resolve resources or referenced component-descriptors. Returns error if verification fails.
Types ¶
type AccessSpec ¶
type AccessSpec interface { runtime.VersionedTypedObject }
AccessSpec is an abstract specification of an access method The outbound object is typicall a runtime.UnstructuredTypedObject. Inbound any serializable AccessSpec implementation is possible.
func GenericAccessSpec ¶
func GenericAccessSpec(un *runtime.UnstructuredTypedObject) AccessSpec
GenericAccessSpec returns a generic AccessSpec implementation for an unstructured object. It can always be used instead of a dedicated access spec implementation. The core methods will map these spec into effective ones before an access is returned to the caller.
type Codec ¶
type Codec interface { Decoder StrictDecoder Encoder }
Codec describes an encoding for en object.
type CodecWrapper ¶
type CodecWrapper struct { Decoder StrictDecoder Encoder }
CodecWrapper is a simple struct that implements the Codec interface.
func (CodecWrapper) ApplyDecodeOption ¶
func (o CodecWrapper) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the configured codec.
func (CodecWrapper) ApplyEncodeOption ¶
func (o CodecWrapper) ApplyEncodeOption(options *EncodeOptions)
ApplyEncodeOption applies the configured codec.
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 metav1.Signatures `json:"signatures,omitempty"` }
ComponentDescriptor defines a versioned component with a source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func Decode ¶
func Decode(data []byte, opts ...DecodeOption) (*ComponentDescriptor, error)
Decode decodes a component into the given object.
func DefaultComponent ¶
func DefaultComponent(component *ComponentDescriptor) *ComponentDescriptor
DefaultComponent applies defaults to a component.
func New ¶
func New(name, version string) *ComponentDescriptor
func (*ComponentDescriptor) AddRepositoryContext ¶
func (cd *ComponentDescriptor) AddRepositoryContext(repoCtx runtime.TypedObject) error
AddRepositoryContext 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 (*ComponentDescriptor) Copy ¶
func (cd *ComponentDescriptor) Copy() *ComponentDescriptor
func (*ComponentDescriptor) GetComponentReferenceByIdentity ¶
func (cd *ComponentDescriptor) GetComponentReferenceByIdentity(id v1.Identity) (ComponentReference, error)
GetComponentReferenceByIdentity returns reference that match the given identity.
func (*ComponentDescriptor) GetComponentReferenceIndex ¶
func (cd *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 (cd *ComponentDescriptor) GetComponentReferences(selectors ...IdentitySelector) ([]ComponentReference, error)
GetComponentReferences returns all component references that matches the given selectors.
func (*ComponentDescriptor) GetComponentReferencesByName ¶
func (cd *ComponentDescriptor) GetComponentReferencesByName(name string) []ComponentReference
GetComponentReferencesByName returns references that match the given name.
func (*ComponentDescriptor) GetEffectiveRepositoryContext ¶
func (cd *ComponentDescriptor) GetEffectiveRepositoryContext() *runtime.UnstructuredTypedObject
GetEffectiveRepositoryContext returns the currently active repository context.
func (*ComponentDescriptor) GetExternalResource ¶
func (cd *ComponentDescriptor) GetExternalResource(rtype, name, version string) (Resource, error)
GetExternalResource returns external resource with the given type, name and version. If multiple resources match, the first one is returned.
func (*ComponentDescriptor) GetExternalResources ¶
func (cd *ComponentDescriptor) GetExternalResources(rtype, name, version string) ([]Resource, error)
GetExternalResources returns external resource with the given type, name and version.
func (*ComponentDescriptor) GetLocalResource ¶
func (cd *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 (cd *ComponentDescriptor) GetLocalResources(rtype, name, version string) ([]Resource, error)
GetLocalResources returns all local resources with the given type, name and version.
func (*ComponentDescriptor) GetReferenceByIdentity ¶
func (cd *ComponentDescriptor) GetReferenceByIdentity(id v1.Identity) (ComponentReference, error)
GetReferenceByIdentity returns reference that match the given identity.
func (*ComponentDescriptor) GetReferenceIndex ¶
func (cd *ComponentDescriptor) GetReferenceIndex(src *ElementMeta) int
GetReferenceIndex returns the index of a given source. If the index is not found -1 is returned.
func (*ComponentDescriptor) GetResourceByDefaultSelector ¶
func (cd *ComponentDescriptor) GetResourceByDefaultSelector(sel interface{}) ([]Resource, error)
GetResourceByDefaultSelector returns resources that match the given selectors.
func (*ComponentDescriptor) GetResourceByIdentity ¶
func (cd *ComponentDescriptor) GetResourceByIdentity(id v1.Identity) (Resource, error)
GetResourceByIdentity returns resource that match the given identity.
func (*ComponentDescriptor) GetResourceByJSONScheme ¶
func (cd *ComponentDescriptor) GetResourceByJSONScheme(src interface{}) ([]Resource, error)
GetResourceByJSONScheme returns resources that match the given selectors.
func (*ComponentDescriptor) GetResourceByRegexSelector ¶
func (cd *ComponentDescriptor) GetResourceByRegexSelector(sel interface{}) ([]Resource, error)
GetResourceByRegexSelector returns resources that match the given selectors.
func (*ComponentDescriptor) GetResourceIndex ¶
func (cd *ComponentDescriptor) GetResourceIndex(res *ResourceMeta) int
GetResourceIndex returns the index of a given resource. If the index is not found -1 is returned.
func (*ComponentDescriptor) GetResourcesByName ¶
func (cd *ComponentDescriptor) GetResourcesByName(name string, selectors ...IdentitySelector) ([]Resource, error)
GetResourcesByName returns all local and external resources with a name.
func (*ComponentDescriptor) GetResourcesBySelector ¶
func (cd *ComponentDescriptor) GetResourcesBySelector(selectors ...IdentitySelector) ([]Resource, error)
GetResourcesBySelector returns resources that match the given selector.
func (*ComponentDescriptor) GetResourcesByType ¶
func (cd *ComponentDescriptor) GetResourcesByType(rtype string, selectors ...IdentitySelector) ([]Resource, error)
GetResourcesByType returns all resources that match the given type and selectors.
func (*ComponentDescriptor) GetSignatureIndex ¶
func (cd *ComponentDescriptor) GetSignatureIndex(name string) int
GetSignatureIndex returns the index of the signature with the given name If the index is not found -1 is returned.
func (*ComponentDescriptor) GetSourceByIdentity ¶
func (cd *ComponentDescriptor) GetSourceByIdentity(id v1.Identity) (Source, error)
GetSourceByIdentity returns source that match the given identity.
func (*ComponentDescriptor) GetSourceIndex ¶
func (cd *ComponentDescriptor) GetSourceIndex(src *SourceMeta) int
GetSourceIndex returns the index of a given source. If the index is not found -1 is returned.
func (*ComponentDescriptor) IsNormalizeable ¶
func (cd *ComponentDescriptor) IsNormalizeable() error
IsNormalizeable checks if componentReferences and resources contain digest. Resources are allowed to omit the digest, if res.access.type == None or res.access == nil. Does NOT verify if the digests are correct.
func (*ComponentDescriptor) Reset ¶
func (cd *ComponentDescriptor) Reset()
func (*ComponentDescriptor) SchemaVersion ¶
func (cd *ComponentDescriptor) SchemaVersion() string
SchemaVersion returns the scheme version configured in the representation.
func (*ComponentDescriptor) SelectSignatureByName ¶
func (cd *ComponentDescriptor) SelectSignatureByName(signatureName string) *metav1.Signature
SelectSignatureByName returns the Signature (Digest and SigantureSpec) matching the given name.
type ComponentDescriptorVersion ¶
type ComponentDescriptorVersion interface { SchemaVersion() string GetName() string GetVersion() string Normalize(normAlgo string) ([]byte, error) }
func Convert ¶
func Convert(obj *ComponentDescriptor, opts ...EncodeOption) (ComponentDescriptorVersion, error)
Convert concerts a component descriptor into ta dedicated schem version. If the serialization version is left blank, the schema version configured in the component descriptor will be used.
type ComponentReference ¶
type ComponentReference struct { ElementMeta `json:",inline"` // ComponentName describes the remote name of the referenced object ComponentName string `json:"componentName"` // Digest is the optional digest of the referenced component. // +optional Digest *metav1.DigestSpec `json:"digest,omitempty"` }
ComponentReference describes the reference to another component in the registry. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func NewComponentReference ¶
func NewComponentReference(name, componentName, version string, extraIdentity metav1.Identity) *ComponentReference
func (*ComponentReference) Copy ¶
func (r *ComponentReference) Copy() *ComponentReference
func (*ComponentReference) GetComponentName ¶
func (r *ComponentReference) GetComponentName() string
func (*ComponentReference) GetMeta ¶
func (r *ComponentReference) GetMeta() *ElementMeta
func (ComponentReference) String ¶
func (r ComponentReference) String() string
type ComponentSpec ¶
type ComponentSpec struct { metav1.ObjectMeta `json:",inline"` // RepositoryContexts defines the previous repositories of the component RepositoryContexts runtime.UnstructuredTypedObjectList `json:"repositoryContexts"` // Sources defines sources that produced the component Sources Sources `json:"sources"` // References references component dependencies that can be resolved in the current context. References References `json:"componentReferences"` // Resources defines all resources that are created by the component and by a third party. Resources Resources `json:"resources"` }
ComponentSpec defines a virtual component with a repository context, source and dependencies. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
type DecodeOption ¶
type DecodeOption interface {
ApplyDecodeOption(options *DecodeOptions)
}
DecodeOption is the interface to specify different cache options.
type DecodeOptions ¶
DecodeOptions defines decode options for the codec.
func (*DecodeOptions) ApplyDecodeOption ¶
func (o *DecodeOptions) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the actual options.
func (*DecodeOptions) ApplyOptions ¶
func (o *DecodeOptions) ApplyOptions(opts []DecodeOption) *DecodeOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
type DecoderFunc ¶
DecoderFunc is a simple function that implements the Decoder interface.
func (DecoderFunc) Decode ¶
func (e DecoderFunc) Decode(data []byte, obj interface{}) error
Decode is the Decode implementation of the Decoder interface.
type DisableValidation ¶
type DisableValidation bool
DisableValidation enables or disables validation of the component descriptor.
func (DisableValidation) ApplyDecodeOption ¶
func (v DisableValidation) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the validation disable option.
type ElementAccessor ¶
type ElementAccessor interface { Len() int Get(i int) ElementMetaAccessor }
ElementAccessor provides generic access to list of elements.
type ElementMeta ¶
type ElementMeta 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"` // ExtraIdentity is the identity of an object. // An additional label with key "name" ist not allowed ExtraIdentity metav1.Identity `json:"extraIdentity,omitempty"` // Labels defines an optional set of additional labels // describing the object. // +optional Labels metav1.Labels `json:"labels,omitempty"` }
ElementMeta defines a object that is uniquely identified by its identity. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*ElementMeta) Copy ¶
func (o *ElementMeta) Copy() *ElementMeta
func (*ElementMeta) GetIdentity ¶
func (o *ElementMeta) GetIdentity(accessor ElementAccessor) metav1.Identity
GetIdentity returns the identity of the object.
func (*ElementMeta) GetIdentityDigest ¶
func (o *ElementMeta) GetIdentityDigest(accessor ElementAccessor) []byte
GetIdentityDigest returns the digest of the object's identity.
func (*ElementMeta) GetLabels ¶
func (o *ElementMeta) GetLabels() metav1.Labels
GetLabels returns the label of the object.
func (*ElementMeta) GetMatchBaseIdentity ¶
func (o *ElementMeta) GetMatchBaseIdentity() metav1.Identity
GetMatchBaseIdentity returns all possible identity attributes for resource matching.
func (*ElementMeta) GetName ¶
func (o *ElementMeta) GetName() string
GetName returns the name of the object.
func (*ElementMeta) GetVersion ¶
func (o *ElementMeta) GetVersion() string
GetVersion returns the version of the object.
func (*ElementMeta) RemoveLabel ¶
func (o *ElementMeta) RemoveLabel(name string) bool
RemoveLabel removes a single label.
func (*ElementMeta) SetExtraIdentity ¶
func (o *ElementMeta) SetExtraIdentity(identity metav1.Identity)
SetExtraIdentity sets the identity of the object.
func (*ElementMeta) SetLabel ¶
func (o *ElementMeta) SetLabel(name string, value interface{}) error
SetLabel sets a single label to an effective value. If the value is no byte slice, it is marshaled.
func (*ElementMeta) SetLabels ¶
func (o *ElementMeta) SetLabels(labels []metav1.Label)
SetLabels sets the labels of the object.
func (*ElementMeta) SetName ¶
func (o *ElementMeta) SetName(name string)
SetName sets the name of the object.
func (*ElementMeta) SetVersion ¶
func (o *ElementMeta) SetVersion(version string)
SetVersion sets the version of the object.
type ElementMetaAccessor ¶
type ElementMetaAccessor interface {
GetMeta() *ElementMeta
}
ElementMetaAccessor provides generic access an elements meta information.
type EncodeOption ¶
type EncodeOption interface {
ApplyEncodeOption(options *EncodeOptions)
}
EncodeOption is the interface to specify different encode options.
type EncodeOptions ¶
func (*EncodeOptions) ApplyEncodeOption ¶
func (o *EncodeOptions) ApplyEncodeOption(options *EncodeOptions)
ApplyDecodeOption applies the actual options.
func (*EncodeOptions) ApplyOptions ¶
func (o *EncodeOptions) ApplyOptions(opts []EncodeOption) *EncodeOptions
ApplyOptions applies the given list options on these options, and then returns itself (for convenient chaining).
func (*EncodeOptions) DefaultFor ¶
func (o *EncodeOptions) DefaultFor(cd *ComponentDescriptor) *EncodeOptions
type EncoderFunc ¶
EncoderFunc is a simple function that implements the Encoder interface.
func (EncoderFunc) Encode ¶
func (e EncoderFunc) Encode(obj interface{}) ([]byte, error)
Encode is the Encode implementation of the Encoder interface.
type IdentitySelector ¶
type LabelsAccessor ¶
type LabelsAccessor interface { // GetLabels returns the labels of the object. GetLabels() metav1.Labels // SetLabels sets the labels of the object. SetLabels(labels []metav1.Label) }
LabelsAccessor describes a accessor for a labeled object.
type Metadata ¶
type Metadata struct {
ConfiguredVersion string `json:"configuredSchemaVersion"`
}
Metadata defines the configured metadata of the component descriptor. It is taken from the original serialization format. It can be set to define a default serialization version.
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" JsonNormalisationV2 NormalisationAlgorithm = "jsonNormalisation/v2" )
type Normalization ¶
type Normalization interface {
Normalize(cd *ComponentDescriptor) ([]byte, error)
}
type NormalizationAlgorithms ¶
func (*NormalizationAlgorithms) Get ¶
func (n *NormalizationAlgorithms) Get(algo string) Normalization
func (*NormalizationAlgorithms) Names ¶
func (n *NormalizationAlgorithms) Names() []string
func (*NormalizationAlgorithms) Normalize ¶
func (n *NormalizationAlgorithms) Normalize(cd *ComponentDescriptor, algo string) ([]byte, error)
func (*NormalizationAlgorithms) Register ¶
func (n *NormalizationAlgorithms) Register(name string, norm Normalization)
type ObjectMeta ¶
type ObjectMeta = metav1.ObjectMeta
type ObjectMetaAccessor ¶
type ObjectMetaAccessor interface { NameAccessor VersionAccessor LabelsAccessor }
ObjectMetaAccessor describes a accessor for named and versioned object.
type References ¶
type References []ComponentReference
func (References) Copy ¶
func (r References) Copy() References
func (References) Get ¶
func (r References) Get(i int) ElementMetaAccessor
func (References) Len ¶
func (r References) Len() int
func (References) Less ¶
func (r References) Less(i, j int) bool
func (References) Swap ¶
func (r References) Swap(i, j int)
type Resource ¶
type Resource struct { ResourceMeta `json:",inline"` // Access describes the type specific method to // access the defined resource. Access AccessSpec `json:"access"` }
Resource describes a resource dependency of a component. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Resource) GetMeta ¶
func (r *Resource) GetMeta() *ElementMeta
type ResourceMeta ¶
type ResourceMeta struct { ElementMeta `json:",inline"` // Type describes the type of the object. Type string `json:"type"` // Relation describes the relation of the resource to the component. // Can be a local or external resource Relation metav1.ResourceRelation `json:"relation,omitempty"` // SourceRef defines a list of source names. // These names reference the sources defines in `component.sources`. SourceRef SourceRefs `json:"srcRef,omitempty"` // Digest is the optional digest of the referenced resource. // +optional Digest *metav1.DigestSpec `json:"digest,omitempty"` }
ResourceMeta describes the meta data of a resource. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*ResourceMeta) Copy ¶
func (o *ResourceMeta) Copy() *ResourceMeta
Copy copies a resource meta.
func (*ResourceMeta) GetType ¶
func (o *ResourceMeta) GetType() string
GetType returns the type of the object.
func (*ResourceMeta) HashEqual ¶
func (o *ResourceMeta) HashEqual(r *ResourceMeta) bool
HashEqual indicates whether the digest hash would be equal. Excluded: Labels Adapt together with version specific hash excludes.
func (*ResourceMeta) SetType ¶
func (o *ResourceMeta) SetType(ttype string)
SetType sets the type of the object.
type ResourceSelectorFunc ¶
ResourceSelectorFunc defines a function to filter a resource.
func NewRelationResourceSelector ¶
func NewRelationResourceSelector(relation v1.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 Resources ¶
type Resources []Resource
Resources describes a set of resource specifications.
func (Resources) Get ¶
func (r Resources) Get(i int) ElementMetaAccessor
type SchemaVersion ¶
type SchemaVersion string
SchemaVersion enforces a dedicated schema version .
func (SchemaVersion) ApplyEncodeOption ¶
func (o SchemaVersion) ApplyEncodeOption(options *EncodeOptions)
ApplyEncodeOption applies the configured schema version.
type Scheme ¶
type Scheme interface { GetVersion() string Decode(data []byte, opts *DecodeOptions) (ComponentDescriptorVersion, error) ConvertFrom(desc *ComponentDescriptor) (ComponentDescriptorVersion, error) ConvertTo(ComponentDescriptorVersion) (*ComponentDescriptor, error) }
type Source ¶
type Source struct { SourceMeta `json:",inline"` Access AccessSpec `json:"access"` }
Source is the definition of a component's source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*Source) GetMeta ¶
func (s *Source) GetMeta() *ElementMeta
type SourceMeta ¶
type SourceMeta struct { ElementMeta // Type describes the type of the object. Type string `json:"type"` }
SourceMeta is the definition of the meta data of a source. +k8s:deepcopy-gen=true +k8s:openapi-gen=true
func (*SourceMeta) GetType ¶
func (o *SourceMeta) GetType() string
GetType returns the type of the object.
func (*SourceMeta) SetType ¶
func (o *SourceMeta) SetType(ttype string)
SetType sets the type of the object.
type SourceRef ¶
type SourceRef struct { // IdentitySelector defines the identity that is used to match a source. IdentitySelector metav1.StringMap `json:"identitySelector,omitempty"` // Labels defines an optional set of additional labels // describing the object. // +optional Labels metav1.Labels `json:"labels,omitempty"` }
SourceRef defines a reference to a source +k8s:deepcopy-gen=true +k8s:openapi-gen=true
type SourceRefs ¶
type SourceRefs []SourceRef
type Sources ¶
type Sources []Source
Sources describes a set of source specifications.
func (Sources) Get ¶
func (s Sources) Get(i int) ElementMetaAccessor
type StrictDecoder ¶
StrictDecoder defines a decoder for an object.
type StrictDecoderFunc ¶
StrictDecoderFunc is a simple function that implements the StrictDecoder interface.
func (StrictDecoderFunc) DecodeStrict ¶
func (e StrictDecoderFunc) DecodeStrict(data []byte, obj interface{}) error
StrictDecode is the Decode implementation of the Decoder interface.
type StrictMode ¶
type StrictMode bool
StrictMode enables or disables strict mode parsing.
func (StrictMode) ApplyDecodeOption ¶
func (s StrictMode) ApplyDecodeOption(options *DecodeOptions)
ApplyDecodeOption applies the configured strict mode.
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.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
meta
|
|
jsonv1
Package jsonv1 provides a normalization which uses schema specific normalizations.
|
Package jsonv1 provides a normalization which uses schema specific normalizations. |
jsonv2
Package jsonv2 provides a normalization which is completely based on the abstract (internal) version of the component descriptor and is therefore agnostic of the final serialization format.
|
Package jsonv2 provides a normalization which is completely based on the abstract (internal) version of the component descriptor and is therefore agnostic of the final serialization format. |
ocm.gardener.cloud/v3alpha1/jsonscheme
Package jsonscheme generated by go-bindata.
|
Package jsonscheme generated by go-bindata. |
ocm.software/v3alpha1/jsonscheme
Package jsonscheme generated by go-bindata.
|
Package jsonscheme generated by go-bindata. |
v2/jsonscheme
Package jsonscheme generated by go-bindata.
|
Package jsonscheme generated by go-bindata. |