testutils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const LocalRepositoryType = "local"

LocalRepositoryType defines the local repository context type.

Variables

This section is empty.

Functions

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)

func NewTestComponentVersionFromReader

func NewTestComponentVersionFromReader(cd *types.ComponentDescriptor) model.ComponentVersion

NewTestComponentVersionFromReader returns a ComponentVersion for test purposes. It cannot be used to access referenced components.

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 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

func (*LocalFilesystemBlobResolver) Info

func (*LocalFilesystemBlobResolver) Resolve

Resolve fetches the blob for a given resource and writes it to the given tar.

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 TestComponentVersion

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

func (*TestComponentVersion) GetComponentDescriptor

func (t *TestComponentVersion) GetComponentDescriptor() *types.ComponentDescriptor

func (*TestComponentVersion) GetComponentReference

func (t *TestComponentVersion) GetComponentReference(name string) *types.ComponentReference

func (*TestComponentVersion) GetComponentReferences

func (t *TestComponentVersion) GetComponentReferences() []types.ComponentReference

func (*TestComponentVersion) GetName

func (c *TestComponentVersion) GetName() string

func (*TestComponentVersion) GetReferencedComponentVersion

func (t *TestComponentVersion) GetReferencedComponentVersion(ctx context.Context, ref *types.ComponentReference, repositoryContext *types.UnstructuredTypedObject, overwriter componentoverwrites.Overwriter) (model.ComponentVersion, error)

func (*TestComponentVersion) GetRepositoryContext

func (t *TestComponentVersion) GetRepositoryContext() *types.UnstructuredTypedObject

func (*TestComponentVersion) GetResource

func (t *TestComponentVersion) GetResource(name string, identity map[string]string) (model.Resource, error)

func (*TestComponentVersion) GetSchemaVersion

func (c *TestComponentVersion) GetSchemaVersion() string

func (*TestComponentVersion) GetVersion

func (c *TestComponentVersion) GetVersion() string

type TestResource

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

func (*TestResource) GetAccessType

func (r *TestResource) GetAccessType() string

func (*TestResource) GetName

func (r *TestResource) GetName() string

func (*TestResource) GetResource

func (r *TestResource) GetResource() (*types.Resource, error)

func (*TestResource) GetType

func (r *TestResource) GetType() string

func (*TestResource) GetTypedContent

func (r *TestResource) GetTypedContent(ctx context.Context) (*model.TypedResourceContent, error)

func (*TestResource) GetVersion

func (r *TestResource) GetVersion() string

Jump to

Keyboard shortcuts

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