Ejemplo n.º 1
0
Archivo: rds.go Proyecto: nishanths/gae
func (r *dsState) DecodeCursor(s string) (ds.Cursor, error) {
	curs := ds.Cursor(nil)
	err := r.run(func() (err error) {
		curs, err = r.rds.DecodeCursor(s)
		return
	})
	return curs, err
}
					pmap("$key", key("Kind", 3), NEXT,
						"When", 996688461000000),
				}},

				// Original (complex) types are retained when getting the full value.
				{q: nq("Kind").Order("When"), get: []ds.PropertyMap{
					stage1Data[1],
					stage1Data[3],
					stage1Data[2],
				}},
			},

			extraFns: []func(context.Context){
				func(c context.Context) {
					data := ds.Get(c)
					curs := ds.Cursor(nil)

					q := nq("").Filter("__key__ >", key("Kind", 2))

					err := data.Run(q, func(pm ds.PropertyMap, gc ds.CursorCB) bool {
						So(pm, ShouldResemble, pmap(
							"$key", key("__entity_group__", 1, key("Kind", 2)), NEXT,
							"__version__", 1))

						err := error(nil)
						curs, err = gc()
						So(err, ShouldBeNil)
						return false
					})
					So(err, ShouldBeNil)