genericocireg

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 36 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Type   = ocireg.Type
	TypeV1 = ocireg.TypeV1

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

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(ctx cpi.Context, meta *ComponentRepositoryMeta, ocirepo oci.Repository) (cpi.Repository, error)

func NewState

func NewState(mode accessobj.AccessMode, name, version string, access oci.ManifestAccess) (accessobj.State, error)

func NewStateAccess

func NewStateAccess(access oci.ManifestAccess) accessobj.StateAccess

func NewStateHandler

func NewStateHandler(name, version string) accessobj.StateHandler

Types

type ComponentAccess

type ComponentAccess struct {
	// contains filtered or unexported fields
}

func (ComponentAccess) AddVersion

func (c ComponentAccess) AddVersion(access cpi.ComponentVersionAccess) error

func (*ComponentAccess) Close

func (s *ComponentAccess) Close() error

func (*ComponentAccess) Dup

func (ComponentAccess) GetContext

func (c ComponentAccess) GetContext() cpi.Context

func (ComponentAccess) GetName

func (c ComponentAccess) GetName() string

func (*ComponentAccess) IsClosed

func (s *ComponentAccess) IsClosed() bool

func (ComponentAccess) ListVersions

func (c ComponentAccess) ListVersions() ([]string, error)

func (ComponentAccess) LookupVersion

func (c ComponentAccess) LookupVersion(version string) (cpi.ComponentVersionAccess, error)

func (ComponentAccess) NewVersion

func (c ComponentAccess) NewVersion(version string, overrides ...bool) (cpi.ComponentVersionAccess, error)

func (ComponentAccess) View

func (a ComponentAccess) View(main ...bool) (*ComponentAccess, error)

type ComponentDescriptorConfig

type ComponentDescriptorConfig struct {
	ComponentDescriptorLayer *ociv1.Descriptor `json:"componentDescriptorLayer,omitempty"`
}

ComponentDescriptorConfig is a Component-Descriptor OCI configuration that is used to store the reference to the (pseudo-)layer used to store the Component-Descriptor in.

type ComponentNameMapping

type ComponentNameMapping string

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

type ComponentRepositoryMeta

type ComponentRepositoryMeta struct {
	// ComponentNameMapping describes the method that is used to map the "Component Name", "Component Version"-tuples
	// to OCI Image References.
	ComponentNameMapping ComponentNameMapping `json:"componentNameMapping,omitempty"`
	SubPath              string               `json:"subPath,omitempty"`
}

ComponentRepositoryMeta describes config special for a mapping of a component repository to an oci registry.

func DefaultComponentRepositoryMeta

func DefaultComponentRepositoryMeta(meta *ComponentRepositoryMeta) *ComponentRepositoryMeta

func NewComponentRepositoryMeta

func NewComponentRepositoryMeta(subPath string, mapping ComponentNameMapping) *ComponentRepositoryMeta

type ComponentVersion

type ComponentVersion struct {
	*support.ComponentVersionAccess
	// contains filtered or unexported fields
}

type ComponentVersionContainer

type ComponentVersionContainer struct {
	// contains filtered or unexported fields
}

func (*ComponentVersionContainer) AccessMethod

func (*ComponentVersionContainer) AddBlobFor

func (c *ComponentVersionContainer) AddBlobFor(storagectx cpi.StorageContext, blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error)

func (*ComponentVersionContainer) AssureGlobalRef

func (c *ComponentVersionContainer) AssureGlobalRef(d digest.Digest, url, name string) (cpi.AccessSpec, error)

AssureGlobalRef provides a global manifest for a local OCI Artifact.

func (*ComponentVersionContainer) Check

func (c *ComponentVersionContainer) Check() error

func (*ComponentVersionContainer) Close

func (c *ComponentVersionContainer) Close() error

func (*ComponentVersionContainer) ComponentAccess

func (c *ComponentVersionContainer) ComponentAccess() cpi.ComponentAccess

func (*ComponentVersionContainer) GetBlobData

func (c *ComponentVersionContainer) GetBlobData(name string) (cpi.DataAccess, error)

func (*ComponentVersionContainer) GetContext

func (c *ComponentVersionContainer) GetContext() cpi.Context

func (*ComponentVersionContainer) GetDescriptor

func (*ComponentVersionContainer) GetStorageContext

func (*ComponentVersionContainer) IsClosed

func (c *ComponentVersionContainer) IsClosed() bool

func (*ComponentVersionContainer) IsReadOnly

func (c *ComponentVersionContainer) IsReadOnly() bool

func (*ComponentVersionContainer) Repository

func (c *ComponentVersionContainer) Repository() cpi.Repository

func (*ComponentVersionContainer) Update

func (c *ComponentVersionContainer) Update() error

type ComponentVersionInfo

type ComponentVersionInfo struct {
	Error       string          `json:"error,omitempty"`
	Description string          `json:"description"`
	Unparsed    string          `json:"unparsed,omitempty"`
	Descriptor  json.RawMessage `json:"descriptor,omitempty"`
}

type OCIBasedRepository

type OCIBasedRepository interface {
	cpi.Repository
	OCIRepository() ocicpi.Repository
}

type Repository

type Repository struct {
	*RepositoryImpl
	// contains filtered or unexported fields
}

func (*Repository) Close

func (r *Repository) Close() error

func (*Repository) IsClosed

func (r *Repository) IsClosed() bool

type RepositoryImpl

type RepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*RepositoryImpl) Close

func (r *RepositoryImpl) Close() error

func (*RepositoryImpl) ComponentLister

func (r *RepositoryImpl) ComponentLister() cpi.ComponentLister

func (*RepositoryImpl) ExistsComponentVersion

func (r *RepositoryImpl) ExistsComponentVersion(name string, version string) (bool, error)

func (*RepositoryImpl) GetComponents

func (r *RepositoryImpl) GetComponents(prefix string, closure bool) ([]string, error)

func (*RepositoryImpl) GetContext

func (r *RepositoryImpl) GetContext() cpi.Context

func (*RepositoryImpl) GetOCIRepository

func (r *RepositoryImpl) GetOCIRepository() oci.Repository

func (*RepositoryImpl) GetSpecification

func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec

func (*RepositoryImpl) LookupComponent

func (r *RepositoryImpl) LookupComponent(name string) (cpi.ComponentAccess, error)

func (*RepositoryImpl) LookupComponentVersion

func (r *RepositoryImpl) LookupComponentVersion(name string, version string) (cpi.ComponentVersionAccess, error)

func (*RepositoryImpl) MapComponentNameToNamespace

func (r *RepositoryImpl) MapComponentNameToNamespace(name string) (string, error)

func (*RepositoryImpl) NumComponents

func (r *RepositoryImpl) NumComponents(prefix string) (int, error)

func (*RepositoryImpl) OCIRepository

func (r *RepositoryImpl) OCIRepository() ocicpi.Repository

func (*RepositoryImpl) View

func (r *RepositoryImpl) View(main ...bool) (*Repository, error)

type RepositorySpec

type RepositorySpec struct {
	oci.RepositorySpec
	ComponentRepositoryMeta
}

func NewRepositorySpec

func NewRepositorySpec(spec oci.RepositorySpec, meta *ComponentRepositoryMeta) *RepositorySpec

func (*RepositorySpec) AsUniformSpec

func (*RepositorySpec) IsIntermediate

func (a *RepositorySpec) IsIntermediate() bool

func (RepositorySpec) MarshalJSON

func (u RepositorySpec) MarshalJSON() ([]byte, error)

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

func (*RepositorySpec) PathPrefix

func (a *RepositorySpec) PathPrefix() string

func (*RepositorySpec) Repository

func (s *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)

func (*RepositorySpec) UnmarshalJSON

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

type RepositoryType

type RepositoryType struct {
	runtime.ObjectVersionedType
	// contains filtered or unexported fields
}

func NewRepositoryType

func NewRepositoryType(ocictx oci.Context) *RepositoryType

NewRepositoryType creates generic type for any OCI Repository Backend.

func (*RepositoryType) Decode

func (t *RepositoryType) Decode(data []byte, unmarshal runtime.Unmarshaler) (runtime.TypedObject, error)

func (*RepositoryType) LocalSupportForAccessSpec

func (t *RepositoryType) LocalSupportForAccessSpec(ctx cpi.Context, a compdesc.AccessSpec) bool

type StateAccess

type StateAccess struct {
	// contains filtered or unexported fields
}

StateAccess handles the component descriptor persistence in an OCI Manifest.

func (StateAccess) Digest

func (s StateAccess) Digest() digest.Digest

func (*StateAccess) Get

func (s *StateAccess) Get() (accessio.BlobAccess, error)

func (*StateAccess) Put

func (s *StateAccess) Put(data []byte) error

type StateHandler

type StateHandler struct {
	// contains filtered or unexported fields
}

StateHandler handles the encoding of a component descriptor.

func (StateHandler) Decode

func (i StateHandler) Decode(data []byte) (interface{}, error)

Decode always accepts a yaml representation, and therefore json, also.

func (StateHandler) Encode

func (i StateHandler) Encode(d interface{}) ([]byte, error)

Encode always provides a yaml representation.

func (StateHandler) Equivalent

func (i StateHandler) Equivalent(a, b interface{}) bool

func (StateHandler) Initial

func (i StateHandler) Initial() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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