xblob

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	Bucket() *blob.Bucket
	As(i interface{}) bool
	ErrorAs(err error, i interface{}) bool
	ReadAll(ctx context.Context, key string) (_ []byte, err error)
	List(opts *blob.ListOptions) *blob.ListIterator
	ListPage(ctx context.Context, pageToken []byte, pageSize int, opts *blob.ListOptions) (retval []*blob.ListObject, nextPageToken []byte, err error)
	IsAccessible(ctx context.Context) (bool, error)
	Exists(ctx context.Context, key string) (bool, error)
	Attributes(ctx context.Context, key string) (_ *blob.Attributes, err error)
	NewReader(ctx context.Context, key string, opts *blob.ReaderOptions) (Reader, error)
	NewRangeReader(ctx context.Context, key string, offset, length int64, opts *blob.ReaderOptions) (_ Reader, err error)
	WriteAll(ctx context.Context, key string, p []byte, opts *blob.WriterOptions) (err error)
	NewWriter(ctx context.Context, key string, opts *blob.WriterOptions) (_ Writer, err error)
	Copy(ctx context.Context, dstKey, srcKey string, opts *blob.CopyOptions) (err error)
	Delete(ctx context.Context, key string) (err error)
	SignedURL(ctx context.Context, key string, opts *blob.SignedURLOptions) (string, error)
	Close() error
}

Bucket is the wrapped interface with small extension that returns Reader and Writer interfaces instead of specific implementations.

func Wrap

func Wrap(b *blob.Bucket) Bucket

Wrap the input blob to implement Bucket interface.

type Reader

type Reader interface {
	Read([]byte) (int, error)
	Close() error
	ContentType() string
	ModTime() time.Time
	Size() int64
	WriteTo(w io.Writer) (int64, error)
}

Reader is the interface implementation of the gocloud.dev/blob.Reader Using an interface allows to mock up the reader.

type Writer

type Writer interface {
	Write([]byte) (int, error)
	Close() error
	ReadFrom(r io.Reader) (int64, error)
}

Directories

Path Synopsis
Package mockblob is a generated GoMock package.
Package mockblob is a generated GoMock package.

Jump to

Keyboard shortcuts

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