testing

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockLocalCache

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

MockLocalCache implements a in-memory LocalCache for testing

func NewMockLocalCache

func NewMockLocalCache() *MockLocalCache

NewMockLocalCache creates a new mock local cache

func (*MockLocalCache) AddFile

func (m *MockLocalCache) AddFile(path string, content []byte)

AddFile adds a file to the mock cache

func (*MockLocalCache) Location

func (m *MockLocalCache) Location(pkg cache.Package) (path string, exists bool)

Location implements LocalCache

type MockObjectStorage

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

MockObjectStorage implements ObjectStorage interface for testing

func NewMockObjectStorage

func NewMockObjectStorage() *MockObjectStorage

NewMockObjectStorage creates a new mock object storage

func (*MockObjectStorage) AddObject

func (m *MockObjectStorage) AddObject(key string, content []byte)

AddObject adds an object to the mock storage

func (*MockObjectStorage) GetObject

func (m *MockObjectStorage) GetObject(ctx context.Context, key string, dest string) (int64, error)

GetObject implements ObjectStorage

func (*MockObjectStorage) HasObject

func (m *MockObjectStorage) HasObject(ctx context.Context, key string) (bool, error)

HasObject implements ObjectStorage

func (*MockObjectStorage) ListObjects

func (m *MockObjectStorage) ListObjects(ctx context.Context, prefix string) ([]string, error)

ListObjects implements ObjectStorage

func (*MockObjectStorage) UploadObject

func (m *MockObjectStorage) UploadObject(ctx context.Context, key string, src string) error

UploadObject implements ObjectStorage

Jump to

Keyboard shortcuts

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