Documentation ¶
Index ¶
- Constants
- func IsLocalType(typ string) bool
- func NewLocalFilesystemBlobAccess(path, mediaType string) (cdv2.UnstructuredTypedObject, error)
- func NewLocalRepositoryContext(baseURL string) (cdv2.UnstructuredTypedObject, error)
- func NewOCIRegistryAccess(ociImageRef string) (cdv2.UnstructuredTypedObject, error)
- func NewOCIRepositoryContext(baseURL string) (cdv2.UnstructuredTypedObject, error)
- type BaseFilesystemBlobResolver
- type BlueprintResolver
- type FilesystemBlobAccess
- type FilesystemBlobResolver
- func (ca *FilesystemBlobResolver) CanResolve(resource types.Resource) bool
- func (ca *FilesystemBlobResolver) Info(ctx context.Context, res types.Resource) (*ctf.BlobInfo, error)
- func (ca *FilesystemBlobResolver) Resolve(ctx context.Context, res types.Resource, writer io.Writer) (*ctf.BlobInfo, error)
- type LocalFilesystemBlobResolver
- func (ca *LocalFilesystemBlobResolver) CanResolve(resource types.Resource) bool
- func (ca *LocalFilesystemBlobResolver) Info(_ context.Context, res types.Resource) (*ctf.BlobInfo, error)
- func (ca *LocalFilesystemBlobResolver) Resolve(_ context.Context, res types.Resource, writer io.Writer) (*ctf.BlobInfo, error)
- type LocalRepository
- type Manager
- func (m *Manager) Resolve(ctx context.Context, repoCtx cdv2.Repository, name, version string) (*cdv2.ComponentDescriptor, error)
- func (m *Manager) ResolveWithBlobResolver(ctx context.Context, repoCtx cdv2.Repository, name, version string) (*cdv2.ComponentDescriptor, ctf.BlobResolver, error)
- func (m *Manager) Set(registries ...TypedRegistry) error
- func (m *Manager) SetRegistryForAlias(registry TypedRegistry, alias string) error
- func (m *Manager) SharedCache() cache.Cache
- type TypedRegistry
Constants ¶
const ComponentArchiveRepositoryType = "ComponentArchive"
ComponentArchiveRepositoryType defines an alternative local repository context type that can also be handled by this implementation
const FilesystemBlobType = "filesystemBlob"
FilesystemBlobType is the access type of a blob that is located in a filesystem.
const LocalRepositoryType = "local"
LocalRepositoryType defines the local repository context type.
Variables ¶
This section is empty.
Functions ¶
func IsLocalType ¶
func NewLocalFilesystemBlobAccess ¶
func NewLocalFilesystemBlobAccess(path, mediaType string) (cdv2.UnstructuredTypedObject, error)
func NewLocalRepositoryContext ¶
func NewLocalRepositoryContext(baseURL string) (cdv2.UnstructuredTypedObject, error)
func NewOCIRegistryAccess ¶
func NewOCIRegistryAccess(ociImageRef string) (cdv2.UnstructuredTypedObject, error)
func NewOCIRepositoryContext ¶
func NewOCIRepositoryContext(baseURL string) (cdv2.UnstructuredTypedObject, error)
Types ¶
type BaseFilesystemBlobResolver ¶
type BaseFilesystemBlobResolver struct {
// contains filtered or unexported fields
}
BaseFilesystemBlobResolver implements a common method for filesystem.
func (*BaseFilesystemBlobResolver) ResolveFromFs ¶
func (res *BaseFilesystemBlobResolver) ResolveFromFs(blobpath string) (*ctf.BlobInfo, io.ReadCloser, error)
ResolveFromFs resolves a blob from a given path.
type BlueprintResolver ¶
type BlueprintResolver struct {
// contains filtered or unexported fields
}
BlueprintResolver is a blob resolver that can resolve blueprints that are defined as their independent oci artifact.
func (BlueprintResolver) CanResolve ¶
func (b BlueprintResolver) CanResolve(res types.Resource) bool
type FilesystemBlobAccess ¶
type FilesystemBlobAccess struct { cdv2.ObjectType `json:",inline"` // Path to the file on the filesystem Path string `json:"filename"` }
FilesystemBlobAccess describes the access for a blob on the filesystem.
func NewFilesystemBlobAccess ¶
func NewFilesystemBlobAccess(path string) *FilesystemBlobAccess
NewFilesystemBlobAccess creates a new localFilesystemBlob accessor.
func (FilesystemBlobAccess) GetData ¶
func (a FilesystemBlobAccess) GetData() ([]byte, error)
func (*FilesystemBlobAccess) SetData ¶
func (a *FilesystemBlobAccess) SetData(bytes []byte) error
type FilesystemBlobResolver ¶
type FilesystemBlobResolver struct {
BaseFilesystemBlobResolver
}
FilesystemBlobResolver implements the BlobResolver interface for "filesystemBlob" access types.
func (*FilesystemBlobResolver) CanResolve ¶
func (ca *FilesystemBlobResolver) CanResolve(resource types.Resource) bool
type LocalFilesystemBlobResolver ¶
type LocalFilesystemBlobResolver struct {
BaseFilesystemBlobResolver
}
LocalFilesystemBlobResolver implements the BlobResolver interface for "localFilesystemBlob" access types.
func NewLocalFilesystemBlobResolver ¶
func NewLocalFilesystemBlobResolver(fs vfs.FileSystem) *LocalFilesystemBlobResolver
NewLocalFilesystemBlobResolver creates a new local filesystem blob resolver.
func (*LocalFilesystemBlobResolver) CanResolve ¶
func (ca *LocalFilesystemBlobResolver) CanResolve(resource types.Resource) bool
type LocalRepository ¶
type LocalRepository struct { cdv2.ObjectType BaseURL string `json:"baseUrl"` }
LocalRepository describes a local repository
func NewLocalRepository ¶
func NewLocalRepository(baseUrl string) *LocalRepository
NewLocalRepository creates a new local repository
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
func New(sharedCache cache.Cache, clients ...TypedRegistry) (*Manager, error)
New creates a ociClient that can handle multiple clients. The manager can handle a shared cache that is injected into the registries.
func (*Manager) Resolve ¶
func (m *Manager) Resolve(ctx context.Context, repoCtx cdv2.Repository, name, version string) (*cdv2.ComponentDescriptor, error)
func (*Manager) ResolveWithBlobResolver ¶
func (m *Manager) ResolveWithBlobResolver(ctx context.Context, repoCtx cdv2.Repository, name, version string) (*cdv2.ComponentDescriptor, ctf.BlobResolver, error)
func (*Manager) Set ¶
func (m *Manager) Set(registries ...TypedRegistry) error
Set adds registries to the manager.
func (*Manager) SetRegistryForAlias ¶
func (m *Manager) SetRegistryForAlias(registry TypedRegistry, alias string) error
SetRegistryForAlias enables using a specific registry implementation for a different type than its statically configured type (the type returned by registry.Type() )
func (*Manager) SharedCache ¶
SharedCache returns the shared cache for all managed registries. Returns nil if there is no shared cache.
type TypedRegistry ¶
type TypedRegistry interface { ctf.ComponentResolver Type() string }
TypedRegistry describes a registry that can handle the given type.
func NewLocalClient ¶
func NewLocalClient(fs vfs.FileSystem, rootPath string) (TypedRegistry, error)
NewLocalClient creates a new local registry from a root.
func NewOCIRegistryWithOCIClient ¶
func NewOCIRegistryWithOCIClient(log logging.Logger, client ociclient.Client, predefinedComponentDescriptors ...*cdv2.ComponentDescriptor) (TypedRegistry, error)
NewOCIRegistryWithOCIClient creates a new oci registry with a oci ociClient If supplied, it parses and stores predefined component descriptors.