objectstore

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlreadyExistsError

func IsAlreadyExistsError(err error) bool

IsAlreadyExistsError checks if an error indicates an already existing bucket.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks if an error indicates a missing bucket.

Types

type ObjectStore

type ObjectStore interface {
	// CreateBucket creates a new bucket in the object store.
	CreateBucket(bucketName string) error

	// ListBuckets lists the current buckets in the object store.
	ListBuckets() ([]string, error)

	// CheckBucket checks the status of the given bucket.
	CheckBucket(bucketName string) error

	// DeleteBucket deletes a bucket from the object store.
	DeleteBucket(bucketName string) error

	// ListObjects gets all keys in the bucket.
	ListObjects(bucketName string) ([]string, error)

	// ListObjectsWithPrefix gets all keys with the given prefix from the bucket.
	ListObjectsWithPrefix(bucketName string, prefix string) ([]string, error)

	// ListObjectKeyPrefixes gets a list of all object key prefixes that come before the provided delimiter.
	ListObjectKeyPrefixes(bucketName string, delimeter string) ([]string, error)

	// GetObject retrieves the object by it's key from the given bucket.
	GetObject(bucketName string, key string) (io.ReadCloser, error)

	// PutObject creates a new object using the data in body with the given key.
	PutObject(bucketName string, delimeter string, body io.Reader) error

	// DeleteObject deletes the object from the given bucket by it's key.
	DeleteObject(bucketName string, key string) error

	// GetSignedURL gives back a signed URL for the object that expires after the given ttl.
	GetSignedURL(bucketName string, key string, ttl time.Duration) (string, error)
}

ObjectStore is the interface that cloud specific object store implementation must implement.

Jump to

Keyboard shortcuts

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