Documentation ¶
Overview ¶
Package googlestorage is simple Google Cloud Storage client.
It does not include any Camlistore-specific logic.
Index ¶
- Constants
- type Client
- func (c *Client) BucketInfo(bucket string) (*api.Bucket, error)
- func (gsa *Client) DeleteObject(obj *Object) error
- func (gsa *Client) EnumerateObjects(bucket, after string, limit int) ([]SizedObject, error)
- func (c *Client) GetObject(obj *Object) (rc io.ReadCloser, size int64, err error)
- func (c *Client) GetPartialObject(obj Object, offset, length int64) (rc io.ReadCloser, err error)
- func (gsa *Client) PutObject(obj *Object, content io.Reader) error
- func (gsa *Client) StatObject(obj *Object) (size int64, exists bool, err error)
- type Object
- type SizedObject
Constants ¶
const (
// Scope is the OAuth2 scope used for Google Cloud Storage.
Scope = "https://www.googleapis.com/auth/devstorage.read_write"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides access to Google Cloud Storage.
func NewServiceClient ¶
NewServiceClient returns a Client for use when running on Google Compute Engine. This client can access buckets owned by the same project ID as the VM.
func (*Client) BucketInfo ¶
BucketInfo returns information about a bucket.
func (*Client) DeleteObject ¶
DeleteObject removes an object.
func (*Client) EnumerateObjects ¶
func (gsa *Client) EnumerateObjects(bucket, after string, limit int) ([]SizedObject, error)
EnumerateObjects lists the objects in a bucket. If after is non-empty, listing will begin with lexically greater object names. If limit is non-zero, the length of the list will be limited to that number.
func (*Client) GetObject ¶
GetObject fetches a Google Cloud Storage object. The caller must close rc.
func (*Client) GetPartialObject ¶
GetPartialObject fetches part of a Google Cloud Storage object. If length is negative, the rest of the object is returned. The caller must close rc.
type Object ¶
An Object holds the name of an object (its bucket and key) within Google Cloud Storage.
type SizedObject ¶
A SizedObject holds the bucket, key, and size of an object.
func (SizedObject) String ¶
func (so SizedObject) String() string