testutils

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 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 added in v0.108.0

func NewLocalFilesystemBlobAccess(path, mediaType string) (cdv2.UnstructuredTypedObject, error)

func NewLocalRepositoryContext added in v0.108.0

func NewLocalRepositoryContext(baseURL string) (cdv2.UnstructuredTypedObject, error)

func NewOCIRegistryAccess added in v0.108.0

func NewOCIRegistryAccess(ociImageRef string) (cdv2.UnstructuredTypedObject, error)

func NewOCIRepositoryContext added in v0.108.0

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 added in v0.108.0

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

BaseFilesystemBlobResolver implements a common method for filesystem.

func (*BaseFilesystemBlobResolver) ResolveFromFs added in v0.108.0

func (res *BaseFilesystemBlobResolver) ResolveFromFs(blobpath string) (*ctf.BlobInfo, io.ReadCloser, error)

ResolveFromFs resolves a blob from a given path.

type LocalFilesystemBlobResolver added in v0.108.0

type LocalFilesystemBlobResolver struct {
	BaseFilesystemBlobResolver
}

LocalFilesystemBlobResolver implements the BlobResolver interface for "localFilesystemBlob" access types.

func NewLocalFilesystemBlobResolver added in v0.108.0

func NewLocalFilesystemBlobResolver(fs vfs.FileSystem) *LocalFilesystemBlobResolver

NewLocalFilesystemBlobResolver creates a new local filesystem blob resolver.

func (*LocalFilesystemBlobResolver) CanResolve added in v0.108.0

func (ca *LocalFilesystemBlobResolver) CanResolve(resource types.Resource) bool

func (*LocalFilesystemBlobResolver) Info added in v0.108.0

func (*LocalFilesystemBlobResolver) Resolve added in v0.108.0

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

type LocalRepository added in v0.108.0

type LocalRepository struct {
	cdv2.ObjectType
	BaseURL string `json:"baseUrl"`
}

LocalRepository describes a local repository

func NewLocalRepository added in v0.108.0

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 added in v0.108.0

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

func (*TestResource) GetAccessType added in v0.108.0

func (r *TestResource) GetAccessType() string

func (*TestResource) GetName added in v0.108.0

func (r *TestResource) GetName() string

func (*TestResource) GetResource added in v0.108.0

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

func (*TestResource) GetType added in v0.108.0

func (r *TestResource) GetType() string

func (*TestResource) GetTypedContent added in v0.108.0

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

func (*TestResource) GetVersion added in v0.108.0

func (r *TestResource) GetVersion() string

Jump to

Keyboard shortcuts

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