gcs

package
v0.0.0-...-e9fe98c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider describes the GCS provider.

func NewCloudStorageProvider

func NewCloudStorageProvider(ctx context.Context, projectID string, bucketName string) *Provider

NewCloudStorageProvider creates a new GCS provider.

func (Provider) CollectionRef

func (p Provider) CollectionRef() string

CollectionRef returns an reference to a storage collection/bucket.

func (Provider) DownloadFile

func (p Provider) DownloadFile(reference, filename string) error

DownloadFile gets the file from the storage provider.

func (Provider) Kind

func (p Provider) Kind() string

Kind returns the kind of provider.

func (Provider) UploadFile

func (p Provider) UploadFile(filename, reference string) error

UploadFile puts the given file to the storage provider.

type Storage

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

Storage describes a new GCS client storage object.

func (*Storage) GetReadCloser

func (s *Storage) GetReadCloser(bucket, ref string) (io.ReadCloser, error)

GetReadCloser gets a new io.ReadCloser for the storage client.

func (*Storage) GetWriteCloser

func (s *Storage) GetWriteCloser(bucket, ref string) (io.WriteCloser, error)

GetWriteCloser gets a new io.WriteCloser for the storage client.

type StorageClient

type StorageClient interface {
	GetWriteCloser(bucket, ref string) (io.WriteCloser, error)
	GetReadCloser(bucket, ref string) (io.ReadCloser, error)
}

StorageClient interface describes a new storage client.

func GSCClient

func GSCClient(ctx context.Context) StorageClient

GSCClient returns a new StorageClient.

Jump to

Keyboard shortcuts

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