Documentation ¶
Overview ¶
Package gcsx contains utilities for working with Google Cloud Storage (GCS).
Index ¶
- func BucketExists(client *storage.Service, bucket string) (bool, error)
- func CreateBucket(client *storage.Service, project, bucket string) error
- func MakeObject(bucket, path string) string
- func NewClient(ctx context.Context, scope string) (*storage.Service, error)
- func NewUnauthenticatedClient(ctx context.Context) (*storage.Service, error)
- func ParseObject(object string) (bucket, path string, err error)
- func ReadObject(client *storage.Service, bucket, object string) ([]byte, error)
- func Upload(client *storage.Service, project, bucket, object string, r io.Reader) (string, error)
- func WriteObject(client *storage.Service, bucket, object string, r io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketExists ¶
BucketExists returns true iff the given bucket exists.
func CreateBucket ¶
CreateBucket creates a bucket in GCS.
func MakeObject ¶
MakeObject creates a object location from bucket and path. For example, MakeObject("foo", "bar/baz") returns "gs://foo/bar/baz". The bucket must be non-empty.
func NewUnauthenticatedClient ¶
NewUnauthenticatedClient creates a new GCS client without authentication.
func ParseObject ¶
ParseObject deconstructs a GCS object name into (bucket, name).
func ReadObject ¶
ReadObject reads the content of the given object in full.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.