mocks

package
v1.4.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfoMock

type FileInfoMock struct {
	IsDirFn func() bool
	SizeFn  func() int64
}

func (*FileInfoMock) IsDir

func (f *FileInfoMock) IsDir() bool

func (*FileInfoMock) ModTime

func (f *FileInfoMock) ModTime() time.Time

func (*FileInfoMock) Path

func (f *FileInfoMock) Path() string

func (*FileInfoMock) Size

func (f *FileInfoMock) Size() int64

type FileWriterMock

type FileWriterMock struct {
	WriteFn  func([]byte) (int, error)
	CancelFn func() error
	CommitFn func() error
	CloseFn  func() error
}

func (*FileWriterMock) Cancel

func (f *FileWriterMock) Cancel() error

func (*FileWriterMock) Close

func (f *FileWriterMock) Close() error

func (*FileWriterMock) Commit

func (f *FileWriterMock) Commit() error

func (*FileWriterMock) Size

func (f *FileWriterMock) Size() int64

func (*FileWriterMock) Write

func (f *FileWriterMock) Write(p []byte) (int, error)

type MockedImageStore

type MockedImageStore struct {
	DirExistsFn            func(d string) bool
	RootDirFn              func() string
	InitRepoFn             func(name string) error
	ValidateRepoFn         func(name string) (bool, error)
	GetRepositoriesFn      func() ([]string, error)
	GetImageTagsFn         func(repo string) ([]string, error)
	GetImageManifestFn     func(repo string, reference string) ([]byte, string, string, error)
	PutImageManifestFn     func(repo string, reference string, mediaType string, body []byte) (string, error)
	DeleteImageManifestFn  func(repo string, reference string) error
	BlobUploadPathFn       func(repo string, uuid string) string
	NewBlobUploadFn        func(repo string) (string, error)
	GetBlobUploadFn        func(repo string, uuid string) (int64, error)
	BlobUploadInfoFn       func(repo string, uuid string) (int64, error)
	PutBlobChunkStreamedFn func(repo string, uuid string, body io.Reader) (int64, error)
	PutBlobChunkFn         func(repo string, uuid string, from int64, to int64, body io.Reader) (int64, error)
	FinishBlobUploadFn     func(repo string, uuid string, body io.Reader, digest string) error
	FullBlobUploadFn       func(repo string, body io.Reader, digest string) (string, int64, error)
	DedupeBlobFn           func(src string, dstDigest digest.Digest, dst string) error
	DeleteBlobUploadFn     func(repo string, uuid string) error
	BlobPathFn             func(repo string, digest digest.Digest) string
	CheckBlobFn            func(repo string, digest string) (bool, int64, error)
	GetBlobFn              func(repo string, digest string, mediaType string) (io.ReadCloser, int64, error)
	DeleteBlobFn           func(repo string, digest string) error
	GetIndexContentFn      func(repo string) ([]byte, error)
	GetBlobContentFn       func(repo, digest string) ([]byte, error)
	GetReferrersFn         func(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error)
	URLForPathFn           func(path string) (string, error)
	RunGCRepoFn            func(repo string)
}

func (MockedImageStore) BlobPath

func (is MockedImageStore) BlobPath(repo string, digest digest.Digest) string

func (MockedImageStore) BlobUploadInfo

func (is MockedImageStore) BlobUploadInfo(repo string, uuid string) (int64, error)

func (MockedImageStore) BlobUploadPath

func (is MockedImageStore) BlobUploadPath(repo string, uuid string) string

func (MockedImageStore) CheckBlob

func (is MockedImageStore) CheckBlob(repo string, digest string) (bool, int64, error)

func (MockedImageStore) DedupeBlob

func (is MockedImageStore) DedupeBlob(src string, dstDigest digest.Digest, dst string) error

func (MockedImageStore) DeleteBlob

func (is MockedImageStore) DeleteBlob(repo string, digest string) error

func (MockedImageStore) DeleteBlobUpload

func (is MockedImageStore) DeleteBlobUpload(repo string, digest string) error

func (MockedImageStore) DeleteImageManifest

func (is MockedImageStore) DeleteImageManifest(name string, reference string) error

func (MockedImageStore) DirExists

func (is MockedImageStore) DirExists(d string) bool

func (MockedImageStore) FinishBlobUpload

func (is MockedImageStore) FinishBlobUpload(repo string, uuid string, body io.Reader, digest string) error

func (MockedImageStore) FullBlobUpload

func (is MockedImageStore) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)

func (MockedImageStore) GetBlob

func (is MockedImageStore) GetBlob(repo string, digest string, mediaType string) (io.ReadCloser, int64, error)

func (MockedImageStore) GetBlobContent

func (is MockedImageStore) GetBlobContent(repo string, digest string) ([]byte, error)

func (MockedImageStore) GetBlobUpload

func (is MockedImageStore) GetBlobUpload(repo string, uuid string) (int64, error)

func (MockedImageStore) GetImageManifest

func (is MockedImageStore) GetImageManifest(repo string, reference string) ([]byte, string, string, error)

func (MockedImageStore) GetImageTags

func (is MockedImageStore) GetImageTags(name string) ([]string, error)

func (MockedImageStore) GetIndexContent

func (is MockedImageStore) GetIndexContent(repo string) ([]byte, error)

func (MockedImageStore) GetReferrers

func (is MockedImageStore) GetReferrers(
	repo string,
	digest string,
	mediaType string,
) ([]artifactspec.Descriptor, error)

func (MockedImageStore) GetRepositories

func (is MockedImageStore) GetRepositories() ([]string, error)

func (MockedImageStore) InitRepo

func (is MockedImageStore) InitRepo(name string) error

func (MockedImageStore) Lock

func (is MockedImageStore) Lock(t *time.Time)

func (MockedImageStore) NewBlobUpload

func (is MockedImageStore) NewBlobUpload(repo string) (string, error)

func (MockedImageStore) PutBlobChunk

func (is MockedImageStore) PutBlobChunk(
	repo string,
	uuid string,
	from int64,
	to int64,
	body io.Reader,
) (int64, error)

func (MockedImageStore) PutBlobChunkStreamed

func (is MockedImageStore) PutBlobChunkStreamed(repo string, uuid string, body io.Reader) (int64, error)

func (MockedImageStore) PutImageManifest

func (is MockedImageStore) PutImageManifest(
	repo string,
	reference string,
	mediaType string,
	body []byte,
) (string, error)

func (MockedImageStore) RLock

func (is MockedImageStore) RLock(t *time.Time)

func (MockedImageStore) RUnlock

func (is MockedImageStore) RUnlock(t *time.Time)

func (MockedImageStore) RootDir

func (is MockedImageStore) RootDir() string

func (MockedImageStore) RunGCRepo

func (is MockedImageStore) RunGCRepo(repo string)

func (MockedImageStore) URLForPath

func (is MockedImageStore) URLForPath(path string) (string, error)

func (MockedImageStore) Unlock

func (is MockedImageStore) Unlock(t *time.Time)

func (MockedImageStore) ValidateRepo

func (is MockedImageStore) ValidateRepo(name string) (bool, error)

type MockedLint

type MockedLint struct {
	LintFn func(repo string, manifestDigest godigest.Digest, imageStore storage.ImageStore) (bool, error)
}

func (MockedLint) Lint

func (lint MockedLint) Lint(repo string, manifestDigest godigest.Digest, imageStore storage.ImageStore) (bool, error)

type OciLayoutUtilsMock

type OciLayoutUtilsMock struct {
	GetImageManifestsFn         func(image string) ([]ispec.Descriptor, error)
	GetImageBlobManifestFn      func(imageDir string, digest godigest.Digest) (v1.Manifest, error)
	GetImageInfoFn              func(imageDir string, hash v1.Hash) (ispec.Image, error)
	IsValidImageFormatFn        func(image string) (bool, error)
	GetImageTagsWithTimestampFn func(repo string) ([]common.TagInfo, error)
	GetImageLastUpdatedFn       func(imageInfo ispec.Image) time.Time
	GetImagePlatformFn          func(imageInfo ispec.Image) (string, string)
	GetImageVendorFn            func(imageInfo ispec.Image) string
	GetImageManifestSizeFn      func(repo string, manifestDigest godigest.Digest) int64
	GetImageConfigSizeFn        func(repo string, manifestDigest godigest.Digest) int64
	GetRepoLastUpdatedFn        func(repo string) (common.TagInfo, error)
	GetExpandedRepoInfoFn       func(name string) (common.RepoInfo, error)
	GetImageConfigInfoFn        func(repo string, manifestDigest godigest.Digest) (ispec.Image, error)
	CheckManifestSignatureFn    func(name string, digest godigest.Digest) bool
}

func (OciLayoutUtilsMock) CheckManifestSignature

func (olum OciLayoutUtilsMock) CheckManifestSignature(name string, digest godigest.Digest) bool

func (OciLayoutUtilsMock) GetExpandedRepoInfo

func (olum OciLayoutUtilsMock) GetExpandedRepoInfo(name string) (common.RepoInfo, error)

func (OciLayoutUtilsMock) GetImageBlobManifest

func (olum OciLayoutUtilsMock) GetImageBlobManifest(imageDir string, digest godigest.Digest) (v1.Manifest, error)

func (OciLayoutUtilsMock) GetImageConfigInfo

func (olum OciLayoutUtilsMock) GetImageConfigInfo(repo string, manifestDigest godigest.Digest) (ispec.Image, error)

func (OciLayoutUtilsMock) GetImageConfigSize

func (olum OciLayoutUtilsMock) GetImageConfigSize(repo string, manifestDigest godigest.Digest) int64

func (OciLayoutUtilsMock) GetImageInfo

func (olum OciLayoutUtilsMock) GetImageInfo(imageDir string, hash v1.Hash) (ispec.Image, error)

func (OciLayoutUtilsMock) GetImageLastUpdated

func (olum OciLayoutUtilsMock) GetImageLastUpdated(imageInfo ispec.Image) time.Time

func (OciLayoutUtilsMock) GetImageManifestSize

func (olum OciLayoutUtilsMock) GetImageManifestSize(repo string, manifestDigest godigest.Digest) int64

func (OciLayoutUtilsMock) GetImageManifests

func (olum OciLayoutUtilsMock) GetImageManifests(image string) ([]ispec.Descriptor, error)

func (OciLayoutUtilsMock) GetImagePlatform

func (olum OciLayoutUtilsMock) GetImagePlatform(imageInfo ispec.Image) (string, string)

func (OciLayoutUtilsMock) GetImageTagsWithTimestamp

func (olum OciLayoutUtilsMock) GetImageTagsWithTimestamp(repo string) ([]common.TagInfo, error)

func (OciLayoutUtilsMock) GetImageVendor

func (olum OciLayoutUtilsMock) GetImageVendor(imageInfo ispec.Image) string

func (OciLayoutUtilsMock) GetRepoLastUpdated

func (olum OciLayoutUtilsMock) GetRepoLastUpdated(repo string) (common.TagInfo, error)

func (OciLayoutUtilsMock) IsValidImageFormat

func (olum OciLayoutUtilsMock) IsValidImageFormat(image string) (bool, error)

type StorageDriverMock

type StorageDriverMock struct {
	NameFn       func() string
	GetContentFn func(ctx context.Context, path string) ([]byte, error)
	PutContentFn func(ctx context.Context, path string, content []byte) error
	ReaderFn     func(ctx context.Context, path string, offset int64) (io.ReadCloser, error)
	WriterFn     func(ctx context.Context, path string, isAppend bool) (driver.FileWriter, error)
	StatFn       func(ctx context.Context, path string) (driver.FileInfo, error)
	ListFn       func(ctx context.Context, path string) ([]string, error)
	MoveFn       func(ctx context.Context, sourcePath, destPath string) error
	DeleteFn     func(ctx context.Context, path string) error
	WalkFn       func(ctx context.Context, path string, f driver.WalkFn) error
}

func (*StorageDriverMock) Delete

func (s *StorageDriverMock) Delete(ctx context.Context, path string) error

func (*StorageDriverMock) GetContent

func (s *StorageDriverMock) GetContent(ctx context.Context, path string) ([]byte, error)

func (*StorageDriverMock) List

func (s *StorageDriverMock) List(ctx context.Context, path string) ([]string, error)

func (*StorageDriverMock) Move

func (s *StorageDriverMock) Move(ctx context.Context, sourcePath, destPath string) error

func (*StorageDriverMock) Name

func (s *StorageDriverMock) Name() string

func (*StorageDriverMock) PutContent

func (s *StorageDriverMock) PutContent(ctx context.Context, path string, content []byte) error

func (*StorageDriverMock) Reader

func (s *StorageDriverMock) Reader(ctx context.Context, path string, offset int64) (io.ReadCloser, error)

func (*StorageDriverMock) Stat

func (*StorageDriverMock) URLFor

func (s *StorageDriverMock) URLFor(ctx context.Context, path string, options map[string]interface{}) (string, error)

func (*StorageDriverMock) Walk

func (s *StorageDriverMock) Walk(ctx context.Context, path string, f driver.WalkFn) error

func (*StorageDriverMock) Writer

func (s *StorageDriverMock) Writer(ctx context.Context, path string, isAppend bool) (driver.FileWriter, error)

Jump to

Keyboard shortcuts

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