blob

package
v0.0.0-...-05ee0c8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package blob contains types and methods for accessing binary data from arbitrary blob storage providers.

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("key not found")

ErrKeyNotFound is the error given when querying a key within a bucket that does not exist.

Functions

This section is empty.

Types

type Bucket

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

The Bucket type represents a collection of keyed binary objects.

func OpenBucket

func OpenBucket(ctx context.Context, bucketURL string) (*Bucket, error)

OpenBucket returns a new Bucket corresponding to the given URL.

func (*Bucket) Close

func (b *Bucket) Close() error

Close the connection to the Bucket.

func (*Bucket) NewReader

func (b *Bucket) NewReader(ctx context.Context, key string) (io.ReadCloser, error)

NewReader returns an io.ReadCloser implementation whose contents are the binary data corresponding to the given key. Returns ErrKeyNotFound if the provided key does not correspond to a blob in the Bucket.

func (*Bucket) Walk

func (b *Bucket) Walk(ctx context.Context, fn filepath.WalkFunc) error

Walk the contents of the Bucket, invoking the filepath.WalkFunc for each blob found. It will iterate throughout all keys in the bucket until finished, an error occurs or the provided context is cancelled.

type FileInfo

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

The FileInfo type is a fs.FileInfo implementation that describes the value of a keyed blob within a bucket.

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool

IsDir returns true if the key is a directory.

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

ModTime returns the time the value of the key was last modified.

func (FileInfo) Mode

func (f FileInfo) Mode() fs.FileMode

Mode always returns zero.

func (FileInfo) Name

func (f FileInfo) Name() string

Name returns the basename of the key.

func (FileInfo) Size

func (f FileInfo) Size() int64

Size returns the size of the blob in bytes.

func (FileInfo) Sys

func (f FileInfo) Sys() interface{}

Sys always returns nil.

Jump to

Keyboard shortcuts

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