objectstorage

package
v0.0.0-...-b5648fb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyObject

func CopyObject(session *openstack.Session, srcURL, destURL string) (err error)

CopyObject calls the OpenStack copy object API using previously obtained token. Note from API doc: "The destination container must exist before attempting the copy."

func DeleteContainer

func DeleteContainer(session *openstack.Session, url string) error

DeleteContainer calls the OpenStack delete container API using previously obtained token.

func DeleteObject

func DeleteObject(session *openstack.Session, url string) (err error)

DeleteObject calls the OpenStack delete object API using previously obtained token.

Note from API doc: "A DELETE to a versioned object removes the current version of the object and replaces it with the next-most current version, moving it from the non-current container to the current." .. "If you want to completely remove an object and you have five total versions of it, you must DELETE it five times."

func GetAccountMeta

func GetAccountMeta(session *openstack.Session, url string) (http.Header, error)

GetAccountMeta calls the OpenStack retrieve account metadata API using previously obtained token.

func GetContainerMeta

func GetContainerMeta(session *openstack.Session, url string) (http.Header, error)

GetContainerMeta calls the OpenStack retrieve object metadata API using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func GetObject

func GetObject(session *openstack.Session, url string) (http.Header, []byte, error)

GetObject calls the OpenStack retrieve object API using previously obtained token. It returns http.Header, object / file content downloaded from the server, and err.

Since this implementation of GetObject retrieves header info, it effectively executes GetObjectMeta also in addition to getting the object content.

func GetObjectMeta

func GetObjectMeta(session *openstack.Session, url string) (http.Header, error)

GetObjectMeta calls the OpenStack retrieve object metadata API using previously obtained token.

func ListContainers

func ListContainers(session *openstack.Session, limit int64, marker, url string) ([]byte, error)

ListContainers calls the OpenStack list containers API using previously obtained token. "limit" and "marker" corresponds to the API's "limit" and "marker". "url" can be regular storage or cdn-enabled storage URL. It returns []byte which then needs to be unmarshalled to decode the JSON.

func ListObjects

func ListObjects(session *openstack.Session, limit int64,
	marker, prefix, path, delim, conURL string) ([]byte, error)

ListObjects calls the OpenStack list object API using previously obtained token. "Limit", "marker", "prefix", "path", "delim" corresponds to the API's "limit", "marker", "prefix", "path", and "delimiter".

func PutContainer

func PutContainer(session *openstack.Session, url string, headers http.Header) error

PutContainer calls the OpenStack API to create / update container using previously obtained token.

func PutObject

func PutObject(session *openstack.Session, fContent *[]byte, url string, headers http.Header) (err error)

PutObject calls the OpenStack create object API using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func SetContainerMeta

func SetContainerMeta(session *openstack.Session, url string, headers http.Header) (err error)

SetContainerMeta calls the OpenStack API to create / update meta data for container using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func SetObjectMeta

func SetObjectMeta(session *openstack.Session, url string, headers http.Header) (err error)

SetObjectMeta calls the OpenStack API to create/update meta data for object using previously obtained token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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