Documentation ¶
Index ¶
- type BlockStore
- type BucketData
- type InMemoryObjectStore
- func (o *InMemoryObjectStore) ClearBucket(bucket string)
- func (o *InMemoryObjectStore) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error)
- func (o *InMemoryObjectStore) DeleteObject(bucket, key string) error
- func (o *InMemoryObjectStore) GetObject(bucket, key string) (io.ReadCloser, error)
- func (o *InMemoryObjectStore) Init(config map[string]string) error
- func (o *InMemoryObjectStore) ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)
- func (o *InMemoryObjectStore) ListObjects(bucket, prefix string) ([]string, error)
- func (o *InMemoryObjectStore) PutObject(bucket, key string, body io.Reader) error
- type ObjectStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStore ¶
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 Ark.
type BucketData ¶
type InMemoryObjectStore ¶
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 ¶
func NewInMemoryObjectStore(buckets ...string) *InMemoryObjectStore
func (*InMemoryObjectStore) ClearBucket ¶
func (o *InMemoryObjectStore) ClearBucket(bucket string)
func (*InMemoryObjectStore) CreateSignedURL ¶
func (*InMemoryObjectStore) DeleteObject ¶
func (o *InMemoryObjectStore) DeleteObject(bucket, key string) error
func (*InMemoryObjectStore) GetObject ¶
func (o *InMemoryObjectStore) GetObject(bucket, key string) (io.ReadCloser, error)
func (*InMemoryObjectStore) Init ¶
func (o *InMemoryObjectStore) Init(config map[string]string) error
func (*InMemoryObjectStore) ListCommonPrefixes ¶
func (o *InMemoryObjectStore) ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)
func (*InMemoryObjectStore) ListObjects ¶
func (o *InMemoryObjectStore) ListObjects(bucket, prefix string) ([]string, error)
type ObjectStore ¶
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 Ark.
Click to show internal directories.
Click to hide internal directories.