Documentation
¶
Overview ¶
Package blob provides types for interacting with blob storage providers such as S3, GCS etc.
Index ¶
- Variables
- type Bucket
- func (b *Bucket) Check(ctx context.Context) error
- func (b *Bucket) Close() error
- func (b *Bucket) Delete(ctx context.Context, path string) error
- func (b *Bucket) Exists(ctx context.Context, path string) (bool, error)
- func (b *Bucket) List(ctx context.Context, filter Filter) iter.Seq2[Object, error]
- func (b *Bucket) Name() string
- func (b *Bucket) NewReader(ctx context.Context, path string) (io.ReadCloser, error)
- func (b *Bucket) NewWriter(ctx context.Context, path string) (io.WriteCloser, error)
- type Filter
- type Object
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotExist is the error given when performing an action against an object that does not exist. ErrNotExist = errors.New("does not exist") )
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
The Bucket type is used to read, write & delete objects from a blob storage provider.
func NewBucket ¶
NewBucket returns a new instance of the Bucket type that performs actions against a blob storage provider. The provider is determined by the URL string. See the gocloud.dev documentation for information on provider specific URLs.
func (*Bucket) Check ¶ added in v0.9.0
Check determines if the bucket is accessible. This method is used to implement the operation.Checker interface for use in health checks.
func (*Bucket) Delete ¶
Delete an object at a specified path. Returns ErrNotExist if the object does not exist.
func (*Bucket) List ¶
List objects within the bucket that match the given Filter. Provide a nil Filter to return all objects. This method returns an iterator so is used with a range statement. The second range parameter is an error that must be checked on each iteration.
func (*Bucket) Name ¶ added in v0.9.0
Name returns "blob". This method is used to implement the operation.Checker interface for use in health checks.