Documentation ¶
Index ¶
- type BucketIteratorCreatorInterface
- type BucketIteratorInterface
- type Disk
- type HTTPClientInterface
- type Image
- type MetadataGCEInterface
- type ObjectIteratorCreatorInterface
- type ObjectIteratorInterface
- type ResourceDeleter
- type ResourceLocationRetrieverInterface
- type ScratchBucketCreatorInterface
- type StorageClientInterface
- type StorageObject
- type StorageObjectCreatorInterface
- type TarGcsExtractorInterface
- type ZoneValidatorInterface
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 HTTPClientInterface ¶
HTTPClientInterface represents HTTP client
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 UpdateBucket(bucketName string, attrs storage.BucketAttrsToUpdate) 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 ¶
ZoneValidatorInterface represents zone validator which validates if a zone is valid in given project