datastorage

package
v0.0.0-...-685a0e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

use google cloud storage to store media files like image since go cloud storage package is in experimental and may make backwards-incompatible changes, this package should be updated correspondingly

Index

Constants

This section is empty.

Variables

View Source
var ErrNumberNotMatch = errors.New("#key isn't same as #data")

used in PutMulti to enforce that number of keys should equal with number of data

Functions

func Put

func Put(key string, data []byte, ctx appengine.Context) (string, error)

Put stores data into bucket under with filrname "key". if returns a url that can be used to read this data what if data already exist?

func PutMulti

func PutMulti(key []string, data [][]byte, ctx appengine.Context) ([]string, []error)

PutMulti stores multiple item in cloud storage in one stroke. It use goroutine to do multitasking It will return error[0] with ErrNumberNotMatch if the #key isn't same as #datas It will return a slice of strings as url if that item is stored successfully. But if there is an error to store that item, then an error will be put in corresponding space.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL