Example #1
0
File: email.go Project: gaego/user
func GetMulti(c appengine.Context, ids []string) (ee []*Email, err error) {
	key := make([]*datastore.Key, len(ids))
	for k, id := range ids {
		key[k] = datastore.NewKey(c, "Email", id, 0, nil)
	}
	ee = make([]*Email, len(ids))
	for i := range ee {
		ee[i] = new(Email)
	}
	err = ds.GetMulti(c, key, ee)
	for i := range ee {
		ee[i].Key = key[i]
	}
	return
}
Example #2
0
func GetMulti(c appengine.Context, ids []string) (pfs []*Profile, err error) {
	key := make([]*datastore.Key, len(ids))
	for k, id := range ids {
		key[k] = datastore.NewKey(c, "AuthProfile", id, 0, nil)
	}
	pfs = make([]*Profile, len(ids))
	for i := range pfs {
		pfs[i] = new(Profile)
	}
	err = ds.GetMulti(c, key, pfs)
	for i := range pfs {
		pfs[i].Key = key[i]
		pfs[i].Decode()
	}
	return
}