示例#1
0
文件: email.go 项目: 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
}
示例#2
0
文件: profile.go 项目: gaego/auth
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
}