client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: Apache-2.0 Imports: 12 Imported by: 32 modules, 30 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidROWriteOperation = errors.New("the client operates in read only mode. Change 'credentials_source' parameter value ")

ErrInvalidROWriteOperation is returned when credentials associated with the client disallow an attempted write operation.

Functions

func NewSDK

NewSDK returns context and client necessary to instantiate a client based off of the provided configuration.

Types

type GCSBlobstore

type GCSBlobstore struct {
	// contains filtered or unexported fields
}

GCSBlobstore encapsulates interaction with the GCS blobstore

func New

func New(ctx context.Context, gcsClient *storage.Client,
	gcscliConfig *config.GCSCli) (GCSBlobstore, error)

New returns a BlobstoreClient configured to operate using the given config and client.

non-nil error is returned on invalid client or config. If the configuration is incompatible with the GCS bucket, a non-nil error is also returned.

func (GCSBlobstore) Delete

func (client GCSBlobstore) Delete(dest string) error

Delete removes a blob from from the GCS blobstore.

If the object does not exist, Delete returns a nil error.

func (GCSBlobstore) Exists

func (client GCSBlobstore) Exists(dest string) (bool, error)

Exists checks if a blob exists in the GCS blobstore.

func (GCSBlobstore) Get

func (client GCSBlobstore) Get(src string, dest io.Writer) error

Get fetches a blob from the GCS blobstore. Destination will be overwritten if it already exists.

func (GCSBlobstore) Put

func (client GCSBlobstore) Put(src io.ReadSeeker, dest string) error

Put uploads a blob to the GCS blobstore. Destination will be overwritten if it already exists.

Put does not retry if upload fails. This is a change from s3cli/client which does retry an upload multiple times. TODO: implement retry

Jump to

Keyboard shortcuts

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