swift

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 12 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 {
	// contains filtered or unexported fields
}

ObjectStore is swift type that holds client and log

func NewObjectStore

func NewObjectStore(log logrus.FieldLogger) *ObjectStore

NewObjectStore instantiates a Swift ObjectStore.

func (*ObjectStore) CreateSignedURL

func (o *ObjectStore) CreateSignedURL(container, object string, ttl time.Duration) (string, error)

CreateSignedURL creates temporary URL for object in container

func (*ObjectStore) DeleteObject

func (o *ObjectStore) DeleteObject(container, object string) error

DeleteObject deletes object specified by object from container

func (*ObjectStore) GetObject

func (o *ObjectStore) GetObject(container, object string) (io.ReadCloser, error)

GetObject returns body of Swift object defined by container name and object

func (*ObjectStore) Init

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

Init initializes the plugin. After v0.10.0, this can be called multiple times.

func (*ObjectStore) ListCommonPrefixes

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

ListCommonPrefixes returns list of objects in container, that match specified prefix

func (*ObjectStore) ListObjects

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

ListObjects lists objects with prefix in all containers

func (*ObjectStore) ObjectExists

func (o *ObjectStore) ObjectExists(container, object string) (bool, error)

ObjectExists does Get operation and validates result or error to find out if object exists

func (*ObjectStore) PutObject

func (o *ObjectStore) PutObject(container string, object string, body io.Reader) error

PutObject uploads new object into container

Jump to

Keyboard shortcuts

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