Documentation ¶
Overview ¶
Package file provides a client for Google Cloud Storage.
NOTE: The Files API was deprecated on June 11, 2013 (v1.8.1) and will be shut down soon, at which point these functions will no longer work. Use Google Cloud Storage instead (https://cloud.google.com/storage/).
Index ¶
- func Create(c appengine.Context, filename string, opts *CreateOptions) (wc io.WriteCloser, absFilename string, err error)
- func DefaultBucketName(c appengine.Context) (string, error)
- func Delete(c appengine.Context, filename string) error
- func Stat(c appengine.Context, filename string) (os.FileInfo, error)
- type BlobReader
- type CreateOptions
- type FileReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c appengine.Context, filename string, opts *CreateOptions) (wc io.WriteCloser, absFilename string, err error)
Create creates a new file, opened for append.
The file must be closed when done writing.
The provided filename may be absolute ("/gs/bucketname/objectname") or may be just the filename, in which case the bucket is determined from opts. The absolute filename is returned.
func DefaultBucketName ¶
DefaultBucketName returns the name of this application's default Google Cloud Storage bucket.
Types ¶
type BlobReader ¶
BlobReader is the interface available when reading blobs.
type CreateOptions ¶
type CreateOptions struct { // MIMEType is the MIME type to use. // The empty string means to use "application/octet-stream". MIMEType string // The Google Cloud Storage bucket name to use. // The empty string means to use the default bucket. BucketName string }
CreateOptions are the file creation options. A nil *CreateOptions means the same as using all the default values.