storage

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// EventFinalize is the GCS notification event type for object finalization (creation or update)
	EventFinalize string = "OBJECT_FINALIZE"

	// EventDelete is the GCS notification event type for object deletion
	EventDelete string = "OBJECT_DELETE"
)

Variables

This section is empty.

Functions

func Set

func Set(storage Storage)

Set the storage object to use

Types

type Storage

type Storage interface {
	ReaderForObject(ctx context.Context, bucketID string, objectID string) (io.ReadCloser, error)
	WriterForObject(ctx context.Context, bucketID string, objectID string) (io.WriteCloser, error)
	DeleteObject(ctx context.Context, bucketID string, objectID string) error
}

Storage interface to deal with Google Cloud Storage. This interface is here to allow for testing to substitute something different.

func Get

func Get() Storage

Get the Storage object to use

func New

func New() (Storage, error)

New creates a real implementation of the Storage interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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