Documentation ¶
Overview ¶
Package blobstore provides a client for App Engine's persistent blob storage service.
Index ¶
- func Delete(c appengine.Context, blobKey appengine.BlobKey) error
- func DeleteMulti(c appengine.Context, blobKey []appengine.BlobKey) error
- func ParseUpload(req *http.Request) (blobs map[string][]*BlobInfo, other map[string][]string, err error)
- func Send(response http.ResponseWriter, blobKey appengine.BlobKey)
- func UploadURL(c appengine.Context, successPath string, opts *UploadURLOptions) (*url.URL, error)
- type BlobInfo
- type Reader
- type UploadURLOptions
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMulti ¶
DeleteMulti deletes multiple blobs.
func ParseUpload ¶
func ParseUpload(req *http.Request) (blobs map[string][]*BlobInfo, other map[string][]string, err error)
ParseUpload parses the synthetic POST request that your app gets from App Engine after a user's successful upload of blobs. Given the request, ParseUpload returns a map of the blobs received (keyed by HTML form element name) and other non-blob POST parameters.
func Send ¶
func Send(response http.ResponseWriter, blobKey appengine.BlobKey)
Send sets the headers on response to instruct App Engine to send a blob as the response body. This is more efficient than reading and writing it out manually and isn't subject to normal response size limits.
Types ¶
type BlobInfo ¶
type BlobInfo struct { BlobKey appengine.BlobKey ContentType string CreationTime *time.Time Filename string // if provided Size int64 }
BlobInfo is the blob metadata that is stored in the datastore.
type UploadURLOptions ¶
type UploadURLOptions struct { MaxUploadBytes int64 // optional MaxUploadBytesPerBlob int64 // optional }
UploadURLOptions are the options to create an upload URL.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is used for writing blobs. Blobs aren't fully written until Close is called, at which point the key can be retrieved by calling the Key method.
func Create ¶
Create begins creating a new blob. The provided mimeType if non-empty is stored in the blob's BlobInfo in datastore, else defaults to application/octet-stream. The returned Writer should be written to, then closed, and then its Key method can be called to retrieve the newly-created blob key if there were no errors.
func (*Writer) Close ¶
Close flushes outstanding buffered writes and finalizes the blob. After calling Close the key can be retrieved by calling Key.