Documentation ¶
Index ¶
- type AccessOptionFunc
- type Component
- func (c *Component) Close() error
- func (c *Component) Dup() (ocm.ComponentVersionAccess, error)
- func (c *Component) GetContext() ocm.Context
- func (c *Component) GetDescriptor() *compdesc.ComponentDescriptor
- func (c *Component) GetName() string
- func (c *Component) GetReference(identity ocmmetav1.Identity) (ocm.ComponentReference, error)
- func (c *Component) GetResource(meta ocmmetav1.Identity) (ocm.ResourceAccess, error)
- func (c *Component) GetResources() []ocm.ResourceAccess
- func (c *Component) GetVersion() string
- func (c *Component) Repository() ocm.Repository
- func (c *Component) Update() error
- type Context
- func (c *Context) AccessSpecForSpec(spec compdesc.AccessSpec) (ocm.AccessSpec, error)
- func (c *Context) AddComponent(component *Component) error
- func (c *Context) AttributesContext() datacontext.AttributesContext
- func (c *Context) BlobDigesters() ocm.BlobDigesterRegistry
- func (c *Context) Close() error
- func (c *Context) CredentialsContext() credentials.Context
- func (c *Context) GetAttributes() datacontext.Attributes
- func (c *Context) GetContext() ocm.Context
- func (c *Context) IsAttributesContext() bool
- func (c *Context) LoggingContext() logging.Context
- func (c *Context) OCMContext() ocm.Context
- func (c *Context) RepositoryForSpec(_ ocm.RepositorySpec, _ ...credentials.CredentialsSource) (ocm.Repository, error)
- type Resource
- func (r *Resource[M]) Access() (ocm.AccessSpec, error)
- func (r *Resource[M]) AccessMethod() (ocm.AccessMethod, error)
- func (r *Resource[M]) AccessSpec() ocm.AccessSpec
- func (r *Resource[M]) AsBlobAccess() ocm.BlobAccess
- func (r *Resource[M]) BlobAccess() (ocm.BlobAccess, error)
- func (r *Resource[M]) Close() error
- func (r *Resource[M]) ComponentVersion() ocm.ComponentVersionAccess
- func (r *Resource[M]) Dup() (ocm.AccessMethod, error)
- func (r *Resource[M]) Get() ([]byte, error)
- func (r *Resource[M]) GetComponentVersion() (ocm.ComponentVersionAccess, error)
- func (r *Resource[M]) GetKind() string
- func (r *Resource[M]) GetOCMContext() ocm.Context
- func (r *Resource[M]) GlobalAccess() ocm.AccessSpec
- func (r *Resource[M]) IsLocal() bool
- func (r *Resource[M]) Meta() *ocm.ResourceMeta
- func (r *Resource[M]) MimeType() string
- func (r *Resource[M]) Reader() (io.ReadCloser, error)
- func (r *Resource[M]) ReferenceHint() string
- type Sign
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessOptionFunc ¶
AccessOptionFunc modifies the resource's access settings.
func SetAccessRef ¶
func SetAccessRef(t string) AccessOptionFunc
SetAccessRef completely overrides the globalAccess field of the resource.
func SetAccessType ¶
func SetAccessType(t string) AccessOptionFunc
SetAccessType sets a custom access type for a resource.
type Component ¶
type Component struct { ocm.ComponentVersionAccess Name string Version string Sign *Sign References map[string]ocm.ComponentReference Resources []*Resource[*compdesc.ResourceMeta] ComponentDescriptor *compdesc.ComponentDescriptor // contains filtered or unexported fields }
Component presents a simple layout for a component. If `Sign` is not empty, it's used to sign the component. It should be the byte representation of a private key. This has to implement ocm.ComponentVersionAccess. Add References. Right now, only resources are supported.
func (*Component) GetContext ¶
func (*Component) GetDescriptor ¶
func (c *Component) GetDescriptor() *compdesc.ComponentDescriptor
func (*Component) GetReference ¶ added in v0.21.5
func (*Component) GetResource ¶
func (*Component) GetResources ¶
func (c *Component) GetResources() []ocm.ResourceAccess
func (*Component) GetVersion ¶
func (*Component) Repository ¶
func (c *Component) Repository() ocm.Repository
type Context ¶
type Context struct { // Make sure our context is compliant with ocm.Context. Implemented methods will be added on a need-to basis. ocm.Context // contains filtered or unexported fields }
Context defines a mock OCM context.
func NewFakeOCMContext ¶
func NewFakeOCMContext() *Context
NewFakeOCMContext creates a new fake OCM context.
func (*Context) AccessSpecForSpec ¶ added in v0.14.0
func (c *Context) AccessSpecForSpec(spec compdesc.AccessSpec) (ocm.AccessSpec, error)
func (*Context) AddComponent ¶
func (*Context) AttributesContext ¶ added in v0.19.0
func (c *Context) AttributesContext() datacontext.AttributesContext
func (*Context) BlobDigesters ¶
func (c *Context) BlobDigesters() ocm.BlobDigesterRegistry
func (*Context) CredentialsContext ¶
func (c *Context) CredentialsContext() credentials.Context
func (*Context) GetAttributes ¶
func (c *Context) GetAttributes() datacontext.Attributes
func (*Context) GetContext ¶
func (*Context) IsAttributesContext ¶ added in v0.19.0
func (*Context) LoggingContext ¶
func (*Context) OCMContext ¶ added in v0.19.0
func (*Context) RepositoryForSpec ¶
func (c *Context) RepositoryForSpec( _ ocm.RepositorySpec, _ ...credentials.CredentialsSource, ) (ocm.Repository, error)
type Resource ¶
type Resource[M any] struct { Name string Labels ocmmetav1.Labels Version string Data []byte Kind string Type string Relation ocmmetav1.ResourceRelation // The component that contains this resource. This is a backlink in OCM. Component *Component // AccessOptions to modify the access of the resource. AccessOptions []AccessOptionFunc }
Resource presents a simple layout for a resource that AddComponentVersionToRepository will use.
func (*Resource[M]) Access ¶
func (r *Resource[M]) Access() (ocm.AccessSpec, error)
Access provides some canned settings. This will later on by made configurable as is in getComponentMock.
func (*Resource[M]) AccessMethod ¶
func (r *Resource[M]) AccessMethod() (ocm.AccessMethod, error)
AccessMethod implementation for this is provided by the resource itself to avoid even further indirections.
func (*Resource[M]) AccessSpec ¶
func (r *Resource[M]) AccessSpec() ocm.AccessSpec
func (*Resource[M]) AsBlobAccess ¶ added in v0.19.0
func (r *Resource[M]) AsBlobAccess() ocm.BlobAccess
func (*Resource[M]) BlobAccess ¶ added in v0.19.0
func (r *Resource[M]) BlobAccess() (ocm.BlobAccess, error)
func (*Resource[M]) ComponentVersion ¶
func (r *Resource[M]) ComponentVersion() ocm.ComponentVersionAccess
func (*Resource[M]) GetComponentVersion ¶ added in v0.19.0
func (r *Resource[M]) GetComponentVersion() (ocm.ComponentVersionAccess, error)
func (*Resource[M]) GetOCMContext ¶ added in v0.19.0
func (*Resource[M]) GlobalAccess ¶ added in v0.19.0
func (r *Resource[M]) GlobalAccess() ocm.AccessSpec
func (*Resource[M]) Meta ¶
func (r *Resource[M]) Meta() *ocm.ResourceMeta