Documentation ¶
Index ¶
- Variables
- func GetLatestMainBuild(ctx context.Context, bucket *storage.BucketHandle, path string) (string, error)
- type Client
- func (client *Client) Copy(ctx context.Context, file File, bucket *storage.BucketHandle, remote string, ...) error
- func (client *Client) CopyLocalDir(ctx context.Context, dir string, bucket *storage.BucketHandle, ...) error
- func (client *Client) CopyRemoteDir(ctx context.Context, fromBucket *storage.BucketHandle, from string, ...) error
- func (client *Client) Delete(ctx context.Context, bucket *storage.BucketHandle, path string) error
- func (client *Client) DeleteDir(ctx context.Context, bucket *storage.BucketHandle, path string) error
- func (client *Client) DownloadDirectory(ctx context.Context, bucket *storage.BucketHandle, destPath string, ...) error
- func (client *Client) RemoteCopy(ctx context.Context, file File, fromBucket, toBucket *storage.BucketHandle, ...) error
- func (client *Client) SetRetryer()
- type File
- type FilesFilter
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorNilBucket is returned when a function is called where a bucket argument is expected and the bucket is nil. ErrorNilBucket = errors.New("a bucket must be provided") )
Functions ¶
func GetLatestMainBuild ¶
func GetLatestMainBuild(ctx context.Context, bucket *storage.BucketHandle, path string) (string, error)
GetLatestMainBuild gets the latest main build which is successfully uploaded to the gcs bucket.
Types ¶
type Client ¶
Client wraps the gcloud storage Client with convenient helper functions. By using an embedded type we can still use the functions provided by storage.Client if we need to.
func New ¶
New creates a new Client by checking for the Google Cloud SDK auth key and/or environment variable.
func (*Client) Copy ¶
func (client *Client) Copy(ctx context.Context, file File, bucket *storage.BucketHandle, remote string, trim bool) error
Copy copies a single local file into the bucket at the provided path. trim variable should be set to true if the full object path is needed - false otherwise.
func (*Client) CopyLocalDir ¶
func (client *Client) CopyLocalDir(ctx context.Context, dir string, bucket *storage.BucketHandle, bucketPath string, trim bool) error
CopyLocalDir copies a local directory 'dir' to the bucket 'bucket' at the path 'bucketPath'.
func (*Client) CopyRemoteDir ¶
func (client *Client) CopyRemoteDir(ctx context.Context, fromBucket *storage.BucketHandle, from string, toBucket *storage.BucketHandle, to string) error
CopyRemoteDir copies an entire directory 'from' from the bucket 'fromBucket' into the 'toBucket' at the path 'to'.
func (*Client) DeleteDir ¶
func (client *Client) DeleteDir(ctx context.Context, bucket *storage.BucketHandle, path string) error
DeleteDir deletes a directory at 'path' from the bucket.
func (*Client) DownloadDirectory ¶
func (client *Client) DownloadDirectory(ctx context.Context, bucket *storage.BucketHandle, destPath string, filter FilesFilter) error
DownloadDirectory downloads files from bucket (filtering by FilesFilter) to destPath on disk.
func (*Client) RemoteCopy ¶
func (client *Client) RemoteCopy(ctx context.Context, file File, fromBucket, toBucket *storage.BucketHandle, path string) error
RemoteCopy will copy the file 'file' from the 'fromBucket' to the 'toBucket' at the path 'path'.
func (*Client) SetRetryer ¶
func (client *Client) SetRetryer()
SetRetryer adds a retry strategy for the googleapi client calls that fail.
type File ¶
File represents a file in Google Cloud Storage.
func ListLocalFiles ¶
ListLocalFiles lists files in a local filesystem.
func ListRemoteFiles ¶
func ListRemoteFiles(ctx context.Context, bucket *storage.BucketHandle, filter FilesFilter) ([]File, error)
ListRemoteFiles lists all the files in the directory (filtering by FilesFilter) and returns a File struct for each one.