datastore: Update AllocateIDs to take keys.

Update the Datastore's AllocateIDs call to accept variadic arguments similar
to Get/Put/Delete/Exists. Structs can be supplied to populate their keys
directly, and keys or key slices can be supplied to directly allocate keys.

This adds some Key helper functions:
- SameKind, which asserts that keys reference the same kind.
- Partial, which returns a partial key given a source key.
- WithID, which returns a derivative key with the specified ID.
- NewIncompleteKeys, which allocates a slice of incomplete keys given a kind.

BUG=

Review-Url: https://codereview.chromium.org/2007123002
24 files changed
tree: 945c8ecf54a253fbdb6911b8f88e5947006f702c
  1. filter/
  2. impl/
  3. infra/
  4. service/
  5. tools/
  6. .travis.yml
  7. AUTHORS
  8. codereview.settings
  9. CONTRIBUTORS
  10. doc.go
  11. LICENSE
  12. pre-commit-go.yml
  13. PRESUBMIT.py
  14. README.md
  15. symbols.go
README.md

gae: A Google AppEngine SDK wrapper

designed for testing and extensibility

THIS PACKAGE HAS NO API COMPATIBILITY GUARANTEES. USE UNPINNED AT YOUR OWN PERIL.

(but generally it should be pretty stableish).

GoDoc Build Status Coverage Status

Installing

go get -u github.com/luci/gae/...

Why/What/How

See the godocs.

Versioning

  • Branch master contains the latest code.

Contributing

  • Sign the Google CLA.
  • Make sure your user.email and user.name are configured in git config.
  • Install the pcg git hook: go get -u github.com/maruel/pre-commit-go/cmd/... && pcg

Run the following to setup the code review tool and create your first review:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $HOME/src/depot_tools
export PATH="$PATH:$HOME/src/depot_tools"
cd $GOROOT/github.com/luci/gae
git new-branch work
# or `git checkout -b work origin/master` if you like typing more.

# hack hack

git commit -a -m "This is awesome\[email protected]"
# This will ask for your Google Account credentials.
git cl upload -s
# Wait for LGTM over email.
# Check Commit Queue checkbox in Rietveld codereview site.
# See it tested and landed automatically.

Use git cl help and git cl help <cmd> for more details.