domain

package
v0.0.0-...-fa603ae Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketIteratorCreatorInterface

type BucketIteratorCreatorInterface interface {
	CreateBucketIterator(ctx context.Context, storageClient StorageClientInterface,
		projectID string) BucketIteratorInterface
}

BucketIteratorCreatorInterface represents GCS bucket creator

type BucketIteratorInterface

type BucketIteratorInterface interface {
	Next() (*storage.BucketAttrs, error)
}

BucketIteratorInterface represents GCS bucket iterator

type Disk

type Disk interface {
	GetProject() string
	GetDiskName() string
	GetZone() string
	GetURI() string
}

Disk holds the project, name, zone and URI of a PD.

type HTTPClientInterface

type HTTPClientInterface interface {
	Get(url string) (resp *http.Response, err error)
}

HTTPClientInterface represents HTTP client

type Image

type Image interface {
	GetProject() string
	GetImageName() string
	GetURI() string
}

Image holds the project, name, and URI of a GCP disk image.

type MetadataGCEInterface

type MetadataGCEInterface interface {
	OnGCE() bool
	Zone() (string, error)
	ProjectID() (string, error)
}

MetadataGCEInterface represents GCE metadata

type ObjectIteratorCreatorInterface

type ObjectIteratorCreatorInterface interface {
	CreateObjectIterator(bucket string, objectPath string) ObjectIteratorInterface
}

ObjectIteratorCreatorInterface represents GCS object iterator creator

type ObjectIteratorInterface

type ObjectIteratorInterface interface {
	Next() (*storage.ObjectAttrs, error)
}

ObjectIteratorInterface represents GCS Object iterator

type ResourceDeleter

type ResourceDeleter interface {
	DeleteImagesIfExist(images []Image)
	DeleteDisksIfExist(disks []Disk)
}

ResourceDeleter checks whether images exist. If so, it deletes them.

type ResourceLocationRetrieverInterface

type ResourceLocationRetrieverInterface interface {
	GetZone(storageRegion string, project string) (string, error)
	GetLargestStorageLocation(storageLocation string) string
}

ResourceLocationRetrieverInterface represents Daisy GCE/GCS resource location retriever

type ScratchBucketCreatorInterface

type ScratchBucketCreatorInterface interface {
	CreateScratchBucket(sourceFileFlag string, projectFlag string, fallbackZone string,
		enableUniformBucketLevelAccess bool) (string, string, error)
	IsBucketInProject(project string, bucketName string) bool
}

ScratchBucketCreatorInterface represents Daisy scratch (temporary) bucket creator To rebuild the mock, run `go generate ./...`

type StorageClientInterface

type StorageClientInterface interface {
	CreateBucket(bucketName string, project string, attrs *storage.BucketAttrs) error
	Buckets(projectID string) *storage.BucketIterator
	GetBucketAttrs(bucket string) (*storage.BucketAttrs, error)
	GetBucket(bucket string) *storage.BucketHandle
	GetObject(bucket string, objectPath string) StorageObject
	GetObjects(bucket string, objectPath string) ObjectIteratorInterface
	GetObjectAttrs(bucket string, objectPath string) (*storage.ObjectAttrs, error)
	FindGcsFile(gcsDirectoryPath string, fileExtension string) (*storage.ObjectHandle, error)
	FindGcsFileDepthLimited(gcsDirectoryPath string, fileExtension string, lookupDepth int) (*storage.ObjectHandle, error)
	GetGcsFileContent(gcsObject *storage.ObjectHandle) ([]byte, error)
	WriteToGCS(destinationBucketName string, destinationObjectPath string, reader io.Reader) error
	DeleteGcsPath(gcsPath string) error
	DeleteObject(gcsPath string) error
	Close() error
}

StorageClientInterface represents GCS storage client

type StorageObject

type StorageObject interface {
	Delete() error
	GetObjectHandle() *storage.ObjectHandle
	NewReader() (io.ReadCloser, error)
	NewWriter() io.WriteCloser
	ObjectName() string
	Compose(src ...StorageObject) (*storage.ObjectAttrs, error)
	CopyFrom(src StorageObject) (*storage.ObjectAttrs, error)
}

StorageObject represents GCS Object

type StorageObjectCreatorInterface

type StorageObjectCreatorInterface interface {
	GetObject(bucket string, objectPath string) StorageObject
}

StorageObjectCreatorInterface represents GCS object creator

type TarGcsExtractorInterface

type TarGcsExtractorInterface interface {
	ExtractTarToGcs(tarGcsPath string, destinationGcsPath string) error
}

TarGcsExtractorInterface represents TAR GCS extractor responsible for extracting TAR archives from GCS to GCS

type ZoneValidatorInterface

type ZoneValidatorInterface interface {
	ZoneValid(project string, zone string) error
}

ZoneValidatorInterface represents zone validator which validates if a zone is valid in given project

Jump to

Keyboard shortcuts

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