gcs

package
v0.1.73 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketHandle

type BucketHandle struct {
	stiface.BucketHandle
}

BucketHandle adds functionality to stiface.BucketHandle

func GetBucket

func GetBucket(ctx context.Context, sClient stiface.Client, bucketName string) (*BucketHandle, error)

GetBucket gets an enhanced BucketHandle

func (*BucketHandle) GetFilesSince

func (bh *BucketHandle) GetFilesSince(ctx context.Context, prefix string, filter *regexp.Regexp, after time.Time) ([]*storage.ObjectAttrs, int64, error)

GetFilesSince returns list of all normal file objects with prefix and mTime > after. prefix is the path not including gs://bucket-name/, including the final / Will retry iterator errors up to five total. returns (objects, byteCount, error) Performance: This takes about 5000 objects/second, including objects rejected by the regex and time cutoff.

func (*BucketHandle) HasFiles

func (bh *BucketHandle) HasFiles(ctx context.Context, prefix string) (bool, error)

HasFiles returns boolean indicating whether there are any file objects with the provided prefix. It may iterate over some objects if the first object isn't a file.

Jump to

Keyboard shortcuts

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