blob

package
v0.0.0-...-3adb936 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT, Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Key    string
	Data   []byte
	Source string
}

type Bucket

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

func NewBucket

func NewBucket(
	ctx context.Context,
	bucketURL string,
	options ...BucketOption,
) (*Bucket, error)

func (*Bucket) Close

func (bu *Bucket) Close()

func (*Bucket) Exists

func (bu *Bucket) Exists(ctx context.Context, key string) (ok bool, err error)

func (*Bucket) GetBlob

func (bu *Bucket) GetBlob(ctx context.Context, key string) (b *Blob, err error)

func (*Bucket) List

func (bu *Bucket) List(options ...ListOption) *ListIterator

func (*Bucket) SetBlob

func (bu *Bucket) SetBlob(ctx context.Context, key string, data []byte, opts ...WriteOption) error

func (*Bucket) WithPrefix

func (bu *Bucket) WithPrefix(prefix string) *Bucket

WithPrefix returns a new bucket with the given prefix.

type BucketOption

type BucketOption interface {
	// contains filtered or unexported methods
}

type ListIterator

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

func (*ListIterator) Err

func (it *ListIterator) Err() error

func (*ListIterator) Key

func (it *ListIterator) Key() string

func (*ListIterator) Next

func (it *ListIterator) Next(ctx context.Context) bool

func (*ListIterator) Value

func (it *ListIterator) Value(ctx context.Context) (*Blob, error)

type ListOption

type ListOption interface {
	// contains filtered or unexported methods
}

type NotFoundError

type NotFoundError struct {
	Key string
}

NotFoundError is returned when a key is not found in the bucket.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type OptBucketCacheDir

type OptBucketCacheDir struct {
	CacheDir string
}

type OptBucketNoCache

type OptBucketNoCache struct {
	NoCache bool
}

type OptListPrefix

type OptListPrefix struct {
	Prefix string
}

type OptWriteCacheTTL

type OptWriteCacheTTL struct {
	TTL time.Duration
}

type WriteOption

type WriteOption interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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