gcs

package
v0.3.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package gcs implements Storage based on Google Cloud Storage bucket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, opt *Options) (storage.Storage, error)

New creates new Google Cloud Storage-backed storage with specified options:

- the 'BucketName' field is required and all other parameters are optional.

By default the connection reuses credentials managed by (https://cloud.google.com/sdk/), but this can be disabled by setting IgnoreDefaultCredentials to true.

Types

type Options

type Options struct {
	// BucketName is the name of the GCS bucket where data is stored.
	BucketName string `json:"bucket"`

	// Prefix specifies additional string to prepend to all objects.
	Prefix string `json:"prefix,omitempty"`

	// ServiceAccountCredentials specifies the name of the file with GCS credentials.
	ServiceAccountCredentials string `json:"credentialsFile,omitempty"`

	// ReadOnly causes GCS connection to be opened with read-only scope to prevent accidental mutations.
	ReadOnly bool `json:"readOnly,omitempty"`

	MaxUploadSpeedBytesPerSecond int `json:"maxUploadSpeedBytesPerSecond,omitempty"`

	MaxDownloadSpeedBytesPerSecond int `json:"maxDownloadSpeedBytesPerSecond,omitempty"`
}

Options defines options Google Cloud Storage-backed storage.

Jump to

Keyboard shortcuts

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