Documentation ¶
Overview ¶
Package storage implements a generic Azure storage client, not specific to Camlistore.
Index ¶
- func IsValidContainer(container string) bool
- type Auth
- type Blob
- type BlobProperties
- type Client
- func (c *Client) Containers() ([]*Container, error)
- func (c *Client) Delete(container, key string) error
- func (c *Client) Get(container, key string) (body io.ReadCloser, size int64, err error)
- func (c *Client) GetPartial(container, key string, offset, length int64) (rc io.ReadCloser, err error)
- func (c *Client) ListBlobs(container string, maxResults int) (blobs []*Blob, err error)
- func (c *Client) PutObject(key, container string, md5 hash.Hash, size int64, body io.Reader) error
- func (c *Client) Stat(key, container string) (size int64, reterr error)
- type Container
- type Error
- type XMLError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidContainer ¶
IsValidContainer reports whether container is a valid container name, per Microsoft's naming restrictions.
See http://msdn.microsoft.com/en-us/library/azure/dd135715.aspx
Types ¶
type Auth ¶
Auth contains the credentials needed to connect to Azure storage
type Blob ¶
type Blob struct { Name string Properties BlobProperties }
Blob holds the name and properties of a blob when returned with a list-operation
type BlobProperties ¶
type BlobProperties struct {
ContentLength int `xml:"Content-Length"`
}
BlobProperties holds some information about the blobs. There are many more fields than just the one below, see: http://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
type Client ¶
type Client struct { *Auth Transport http.RoundTripper // or nil for the default // Hostname is the hostname to use in the requests. // By default its <account>.blob.core.windows.net. Hostname string }
Client is an Azure storage client.
func (*Client) Containers ¶
Containers list the containers active under the current account.
func (*Client) Delete ¶
Delete deletes a blob from the specified container. It may take a few moments before the blob is actually deleted by Azure.
func (*Client) Get ¶
Get retrieves a blob from Azure or returns os.ErrNotExist if not found
func (*Client) GetPartial ¶
func (c *Client) GetPartial(container, key string, offset, length int64) (rc io.ReadCloser, err error)
GetPartial fetches part of the blob in container. If length is negative, the rest of the object is returned. The caller must close rc.
func (*Client) ListBlobs ¶
ListBlobs returns 0 to maxKeys (inclusive) items from the provided container. If the length of the returned items is equal to maxKeys, there is no indication whether or not the returned list is truncated.
func (*Client) PutObject ¶
PutObject puts a blob to the specified container on Azure
type Container ¶
type Container struct {
Name string
}
Container is the result of an enumeration of containers TODO(gv): There are come more properties being exposed by Azure that we don't need right now