tardigrade

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectStore

type ObjectStore struct {
	LinksharingBaseURL string
	// contains filtered or unexported fields
}

ObjectStore exposes basic object-storage operations required by Velero.

func NewObjectStore

func NewObjectStore(logger logrus.FieldLogger) *ObjectStore

NewObjectStore creates new Tardigrade object store.

func (*ObjectStore) CreateSignedURL

func (o *ObjectStore) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error)

CreateSignedURL creates a pre-signed URL for the given bucket and key that expires after ttl.

func (*ObjectStore) DeleteObject

func (o *ObjectStore) DeleteObject(bucket, key string) error

DeleteObject removes the object with the specified key from the given bucket.

func (*ObjectStore) GetObject

func (o *ObjectStore) GetObject(bucket, key string) (io.ReadCloser, error)

GetObject retrieves the object with the given key from the specified bucket in object storage.

func (*ObjectStore) Init

func (o *ObjectStore) Init(config map[string]string) error

Init prepares the ObjectStore for usage using the provided map of configuration key-value pairs. It returns an error if the ObjectStore cannot be initialized from the provided config.

Specific config for Tardigrade:

  • accessGrant (required): serialized access grant to Tardigrade project.

func (*ObjectStore) ListCommonPrefixes

func (o *ObjectStore) ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)

ListCommonPrefixes gets a list of all object key prefixes that start with the specified prefix and stop at the next instance of the provided delimiter.

For example, if the bucket contains the following keys:

a-prefix/foo-1/bar
a-prefix/foo-1/baz
a-prefix/foo-2/baz
some-other-prefix/foo-3/bar

and the provided prefix arg is "a-prefix/", and the delimiter is "/", this will return the slice {"a-prefix/foo-1/", "a-prefix/foo-2/"}.

func (*ObjectStore) ListObjects

func (o *ObjectStore) ListObjects(bucket, prefix string) ([]string, error)

ListObjects gets a list of all keys in the specified bucket that have the given prefix.

func (*ObjectStore) ObjectExists

func (o *ObjectStore) ObjectExists(bucket, key string) (bool, error)

ObjectExists checks if there is an object with the given key in the object storage bucket.

func (*ObjectStore) PutObject

func (o *ObjectStore) PutObject(bucket, key string, body io.Reader) error

PutObject creates a new object using the data in body within the specified object storage bucket with the given key.

Jump to

Keyboard shortcuts

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