storagex

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBucket

func NewBucket(cl *storage.Service, project, bucket string) error

NewBucket creates a new GCS bucket in the given project.

func NewClient

func NewClient(ctx context.Context) (*storage.Service, error)

NewClient returns a new GCS client using Application Default Credentials and with Full scope.

func TryDeleteBucket

func TryDeleteBucket(ctx context.Context, cl *storage.Service, bucket string)

TryDeleteBucket tries to delete the given bucket and logs any errors. Intended to deferred cleanup.

func TryDeleteObject

func TryDeleteObject(ctx context.Context, cl *storage.Service, bucket, object string)

TryDeleteObject tries to delete the given object and logs any errors. Intended to deferred cleanup.

func UploadFile

func UploadFile(cl *storage.Service, bucket, object, filename string) error

UploadFile uploads the given file to GCS. It assumes the bucket exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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