Documentation
¶
Overview ¶
Package blob is used to read/write data from blob stores.
Index ¶
- Variables
- type Blob
- type Bucket
- func (bkt *Bucket) Close() error
- func (bkt *Bucket) Delete(ctx context.Context, key string) error
- func (bkt *Bucket) Iterate(ctx context.Context, fn Iterator) error
- func (bkt *Bucket) NewRangeReader(ctx context.Context, key string, offset, length int64) (*Reader, error)
- func (bkt *Bucket) NewReader(ctx context.Context, key string) (*Reader, error)
- func (bkt *Bucket) NewWriter(ctx context.Context, key string) (*Writer, error)
- func (bkt *Bucket) Ping() error
- type Iterator
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ErrNotExist = errors.New("not exist")
ErrNotExist is the error returned when attempting to query blob data that does not exist.
var ErrStopIterating = errors.New("stop iterating")
ErrStopIterating is the error used to stop the iterator from continuing.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
The Bucket type represents a bucket of blob data that can be arbitrarily written to and read using a key.
func OpenBucket ¶
OpenBucket opens the bucket identified by the URL given.
func (*Bucket) Delete ¶
Delete deletes the blob stored at key. Returns ErrNotExist if the key does not exist.
func (*Bucket) Iterate ¶ added in v1.2.0
Iterate over the contents of the bucket, invoking fn for each item, excluding any directories. Iteration can be cancelled via the provided context or by fn returning ErrStopIterating or any other non-nil error.
func (*Bucket) NewRangeReader ¶
func (bkt *Bucket) NewRangeReader(ctx context.Context, key string, offset, length int64) (*Reader, error)
NewRangeReader returns a Reader to read content from the blob stored at key from one offset to a certain number of bytes.
type Iterator ¶ added in v1.2.0
Iterator is a function used on a call to Bucket.Iterate that is invoked for each item in the bucket.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
The Reader type is able to read blob data for a desired key. It is instrumented to write spans to the tracer when blob data is read.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
The Writer type is able to write blob data for a desired key. It is instrumented to write spans to the tracer when blob data is written.