Documentation ¶
Index ¶
- Constants
- func CloseFileAndValidateContentFromGCS(ctx context.Context, storageClient *storage.Client, fh *os.File, ...)
- func CreateImplicitDir(ctx context.Context, storageClient *storage.Client, testDirName string, ...)
- func CreateLocalFileInTestDir(ctx context.Context, storageClient *storage.Client, ...) (string, *os.File)
- func CreateNFilesInDir(ctx context.Context, storageClient *storage.Client, numFiles int, ...) (fileNames []string)
- func CreateObjectInGCSTestDir(ctx context.Context, storageClient *storage.Client, ...)
- func CreateObjectOnGCS(ctx context.Context, client *storage.Client, object, content string) error
- func CreateStorageClient(ctx context.Context) (*storage.Client, error)
- func CreateStorageClientWithTimeOut(ctx *context.Context, storageClient **storage.Client, time time.Duration, ...) func()
- func DeleteAllObjectsWithPrefix(ctx context.Context, client *storage.Client, prefix string) error
- func DeleteObjectOnGCS(ctx context.Context, client *storage.Client, objectName string) error
- func DownloadObjectFromGCS(gcsFile string, destFileName string, t *testing.T) error
- func GetDirName(testDirPath string) string
- func ReadChunkFromGCS(ctx context.Context, client *storage.Client, object string, offset, size int64) (string, error)
- func ReadObjectFromGCS(ctx context.Context, client *storage.Client, object string) (string, error)
- func SetupFileInTestDirectory(ctx context.Context, storageClient *storage.Client, ...)
- func SetupTestDirectory(ctx context.Context, storageClient *storage.Client, testDirName string) string
- func StatObject(ctx context.Context, client *storage.Client, object string) (*storage.ObjectAttrs, error)
- func ValidateObjectChunkFromGCS(ctx context.Context, storageClient *storage.Client, testDirName string, ...)
- func ValidateObjectContentsFromGCS(ctx context.Context, storageClient *storage.Client, testDirName string, ...)
- func ValidateObjectNotFoundErrOnGCS(ctx context.Context, storageClient *storage.Client, testDirName string, ...)
- func WriteToObject(ctx context.Context, client *storage.Client, object, content string, ...) error
Constants ¶
View Source
const ( FileName1 = "foo1" FileName2 = "foo2" FileName3 = "foo3" ExplicitDirName = "explicit" ExplicitFileName1 = "explicitFile1" ImplicitDirName = "implicit" ImplicitFileName1 = "implicitFile1" FileContents = "testString" SizeOfFileContents = 10 GCSFileContent = "GCSteststring" GCSFileSize = 13 FilePerms = 0644 ReadSize = 1024 SizeTruncate = 5 NewFileName = "newName" NewDirName = "newDirName" )
Variables ¶
This section is empty.
Functions ¶
func CreateImplicitDir ¶
func CreateNFilesInDir ¶
func CreateObjectOnGCS ¶
CreateObjectOnGCS creates an object with given name and content on GCS.
func CreateStorageClientWithTimeOut ¶
func CreateStorageClientWithTimeOut(ctx *context.Context, storageClient **storage.Client, time time.Duration, t *testing.T) func()
CreateStorageClientWithTimeOut creates storage client with a configurable timeout and return a function to cancel the storage client
func DeleteObjectOnGCS ¶
func DownloadObjectFromGCS ¶
DownloadObjectFromGCS downloads an object to a local file.
func GetDirName ¶
func ReadChunkFromGCS ¶
func ReadChunkFromGCS(ctx context.Context, client *storage.Client, object string, offset, size int64) (string, error)
ReadChunkFromGCS downloads the object chunk from GCS and returns the data.
func ReadObjectFromGCS ¶
ReadObjectFromGCS downloads the object from GCS and returns the data.
func SetupTestDirectory ¶
func StatObject ¶
func WriteToObject ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.