Documentation ¶
Index ¶
- Constants
- type ACL
- type Client
- func (c *Client) CreateContainer(containerName string, acl ACL) error
- func (c *Client) DeleteContainer(containerName string) error
- func (c *Client) DeleteObject(containerName, objectName string) error
- func (c *Client) GetObject(containerName, objectName string) (obj []byte, err error)
- func (c *Client) GetReader(containerName, objectName string) (_ io.ReadCloser, _ http.Header, err error)
- func (c *Client) HeadObject(containerName, objectName string) (http.Header, error)
- func (c *Client) List(containerName, prefix, delim, marker string, limit int) (contents []ContainerContents, err error)
- func (c *Client) OpenObject(containerName, objectName string, readAhead int64) (Object, http.Header, error)
- func (c *Client) PutObject(containerName, objectName string, data []byte) error
- func (c *Client) PutReader(containerName, objectName string, r io.Reader, length int64) error
- func (c *Client) SignedURL(containerName, file string, expires time.Time) (string, error)
- func (c *Client) URL(containerName, file string) (string, error)
- type ContainerContents
- type Object
Constants ¶
const ( Private = ACL("") PublicRead = ACL(".r:*,.rlistings") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a means to access the OpenStack Object Storage Service.
func (*Client) CreateContainer ¶
CreateContainer creates a container with the given name.
func (*Client) DeleteContainer ¶
DeleteContainer deletes the specified container.
func (*Client) DeleteObject ¶
DeleteObject removes an object from the storage system permanently.
func (*Client) GetReader ¶
func (c *Client) GetReader(containerName, objectName string) (_ io.ReadCloser, _ http.Header, err error)
GetReader returns a reader from which the object's data can be read, and the HTTP header of the initial response.
func (*Client) HeadObject ¶
HeadObject retrieves object metadata and other standard HTTP headers.
func (*Client) List ¶
func (c *Client) List(containerName, prefix, delim, marker string, limit int) (contents []ContainerContents, err error)
List lists the objects in a bucket. TODO describe prefix, delim, marker, limit parameters.
func (*Client) OpenObject ¶
func (c *Client) OpenObject(containerName, objectName string, readAhead int64) (Object, http.Header, error)
OpenObject opens an object for reading. The readAhead parameter governs how much data is scheduled to be read speculatively from the object before actual Read requests are issued. If readAhead is -1, an indefinite amount of data will be requested; if readAhead is 0, no data will be requested.
func (*Client) PutReader ¶
PutReader writes, or overwrites, an object's content and metadata. The object's content will be read from r, and should have the given length. If r does not implement io.Seeker, the entire content will be read into memory before sending the request (so that the request can be retried if needed) otherwise Seek will be used to rewind the request on retry.