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) GetResource(meta ocmmetav1.Identity) (ocm.ResourceAccess, error)
- func (c *Component) GetResources() []ocm.ResourceAccess
- func (c *Component) GetVersion() string
- func (c *Component) Repository() ocm.Repository
- type Context
- func (c *Context) AddComponent(component *Component) error
- 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) LoggingContext() logging.Context
- func (c *Context) RepositoryForSpec(spec ocm.RepositorySpec, creds ...credentials.CredentialsSource) (ocm.Repository, error)
- type Resource
- func (r *Resource) Access() (ocm.AccessSpec, error)
- func (r *Resource) AccessMethod() (ocm.AccessMethod, error)
- func (r *Resource) AccessSpec() ocm.AccessSpec
- func (r *Resource) Close() error
- func (r *Resource) ComponentVersion() ocm.ComponentVersionAccess
- func (r *Resource) Get() ([]byte, error)
- func (r *Resource) GetKind() string
- func (r *Resource) Meta() *ocm.ResourceMeta
- func (r *Resource) MimeType() string
- func (r *Resource) Reader() (io.ReadCloser, error)
- 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 Resources []*Resource 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) 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) AddComponent ¶
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) LoggingContext ¶
func (*Context) RepositoryForSpec ¶
func (c *Context) RepositoryForSpec(spec ocm.RepositorySpec, creds ...credentials.CredentialsSource) (ocm.Repository, error)
type Resource ¶
type Resource struct { Name string 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) Access ¶
func (r *Resource) Access() (ocm.AccessSpec, error)
Access provides some canned settings. This will later on by made configurable as is in getComponentMock.
func (*Resource) AccessMethod ¶
func (r *Resource) AccessMethod() (ocm.AccessMethod, error)
AccessMethod implementation for this is provided by the resource itself to avoid even further indirections.
func (*Resource) AccessSpec ¶
func (r *Resource) AccessSpec() ocm.AccessSpec
func (*Resource) ComponentVersion ¶
func (r *Resource) ComponentVersion() ocm.ComponentVersionAccess
func (*Resource) Meta ¶
func (r *Resource) Meta() *ocm.ResourceMeta