blob

package
v0.0.0-...-9a14138 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAllBytes

func ReadAllBytes(storage Storage, uri string) ([]byte, error)

Types

type LocalStorage

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

LocalStorage keeps objets in the specified local directory. It's intended to be used only for unit tests.

func NewLocalStorage

func NewLocalStorage(baseFolder string) *LocalStorage

func (*LocalStorage) Read

func (ls *LocalStorage) Read(uri string) (io.ReadCloser, error)

func (*LocalStorage) Store

func (ls *LocalStorage) Store(source io.Reader) (string, error)

func (*LocalStorage) Update

func (ls *LocalStorage) Update(uri string, source io.Reader) error

type Storage

type Storage interface {
	// Store returns a URI to use later.
	Store(source io.Reader) (string, error)
	Update(key string, source io.Reader) error
	Read(uri string) (io.ReadCloser, error)
}

Storage is not assumed to be used for partciularly large objects (e.g. GB of size), but rather for blobs that risk overwhelming Spanner column size limits.

func NewGCSClient

func NewGCSClient(ctx context.Context, bucket string) (Storage, error)

Jump to

Keyboard shortcuts

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