gcsx

package
v2.4.0-RC1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gcsx contains utilities for working with Google Cloud Storage (GCS).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeObject

func MakeObject(bucket, path string) string

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 NewClient

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

NewClient creates a new GCS client with default application credentials.

func ParseObject

func ParseObject(object string) (bucket, path string, err error)

ParseObject deconstructs a GCS object name into (bucket, name).

func ReadObject

func ReadObject(client *storage.Service, bucket, object string) ([]byte, error)

ReadObject reads the content of the given object in full.

func WriteObject

func WriteObject(client *storage.Service, bucket, object string, r io.Reader) error

WriteObject writes the given content to the specified object. If the object already exist, it is overwritten.

Types

This section is empty.

Jump to

Keyboard shortcuts

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