cloudprovider

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockStore added in v0.6.0

type BlockStore interface {
	// Init prepares the BlockStore for usage using the provided map of
	// configuration key-value pairs. It returns an error if the BlockStore
	// cannot be initialized from the provided config.
	Init(config map[string]string) error

	// CreateVolumeFromSnapshot creates a new block volume in the specified
	// availability zone, initialized from the provided snapshot,
	// and with the specified type and IOPS (if using provisioned IOPS).
	CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (volumeID string, err error)

	// GetVolumeID returns the cloud provider specific identifier for the PersistentVolume.
	GetVolumeID(pv runtime.Unstructured) (string, error)

	// SetVolumeID sets the cloud provider specific identifier for the PersistentVolume.
	SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)

	// GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for
	// the specified block volume in the given availability zone.
	GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)

	// CreateSnapshot creates a snapshot of the specified block volume, and applies the provided
	// set of tags to the snapshot.
	CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (snapshotID string, err error)

	// DeleteSnapshot deletes the specified volume snapshot.
	DeleteSnapshot(snapshotID string) error
}

BlockStore exposes basic block-storage operations required by Velero.

type BucketData added in v0.10.0

type BucketData map[string][]byte

type InMemoryObjectStore added in v0.10.0

type InMemoryObjectStore struct {
	Data map[string]BucketData
}

InMemoryObjectStore is a simple implementation of the ObjectStore interface that stores its data in-memory/in-proc. This is mainly intended to be used as a test fake.

func NewInMemoryObjectStore added in v0.10.0

func NewInMemoryObjectStore(buckets ...string) *InMemoryObjectStore

func (*InMemoryObjectStore) ClearBucket added in v0.10.0

func (o *InMemoryObjectStore) ClearBucket(bucket string)

func (*InMemoryObjectStore) CreateSignedURL added in v0.10.0

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

func (*InMemoryObjectStore) DeleteObject added in v0.10.0

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

func (*InMemoryObjectStore) GetObject added in v0.10.0

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

func (*InMemoryObjectStore) Init added in v0.10.0

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

func (*InMemoryObjectStore) ListCommonPrefixes added in v0.10.0

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

func (*InMemoryObjectStore) ListObjects added in v0.10.0

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

func (*InMemoryObjectStore) PutObject added in v0.10.0

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

type ObjectStore added in v0.6.0

type ObjectStore interface {
	// 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.
	Init(config map[string]string) error

	// PutObject creates a new object using the data in body within the specified
	// object storage bucket with the given key.
	PutObject(bucket, key string, body io.Reader) error

	// GetObject retrieves the object with the given key from the specified
	// bucket in object storage.
	GetObject(bucket, key string) (io.ReadCloser, 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/"}.
	ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)

	// ListObjects gets a list of all keys in the specified bucket
	// that have the given prefix.
	ListObjects(bucket, prefix string) ([]string, error)

	// DeleteObject removes the object with the specified key from the given
	// bucket.
	DeleteObject(bucket, key string) error

	// CreateSignedURL creates a pre-signed URL for the given bucket and key that expires after ttl.
	CreateSignedURL(bucket, key string, ttl time.Duration) (string, error)
}

ObjectStore exposes basic object-storage operations required by Velero.

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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