1// Copyright 2012 Google Inc. All rights reserved. 2// Use of this source code is governed by the Apache 2.0 3// license that can be found in the LICENSE file. 4 5package file 6 7import ( 8 "io" 9 10 "appengine" 11) 12 13// CreateOptions are the file creation options. 14// A nil *CreateOptions means the same as using all the default values. 15type CreateOptions struct { 16 // MIMEType is the MIME type to use. 17 // The empty string means to use "application/octet-stream". 18 MIMEType string 19 20 // The Google Cloud Storage bucket name to use. 21 // The empty string means to use the default bucket. 22 BucketName string 23} 24 25// Create creates a new file, opened for append. 26// 27// The file must be closed when done writing. 28// 29// The provided filename may be absolute ("/gs/bucketname/objectname") 30// or may be just the filename, in which case the bucket is determined 31// from opts. The absolute filename is returned. 32func Create(c appengine.Context, filename string, opts *CreateOptions) (wc io.WriteCloser, absFilename string, err error) { 33 return nil, "", errDeprecated 34} 35 36// writer is used for writing blobs. Blobs aren't fully written until 37// Close is called, at which point the key can be retrieved by calling 38// the Key method. 39type writer struct { 40} 41 42func (w *writer) Write(p []byte) (n int, err error) { 43 return 0, errDeprecated 44} 45 46func (w *writer) Close() error { 47 return errDeprecated 48} 49