Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 19-Oct-2020 | - | ||||
admin/apiv1/ | H | 19-Oct-2020 | - | 779 | 455 | |
internal/gaepb/ | H | 19-Oct-2020 | - | 433 | 394 | |
testdata/ | H | 19-Oct-2020 | - | 41 | 35 | |
CHANGES.md | H A D | 19-Oct-2020 | 1 KiB | 28 | 21 | |
README.md | H A D | 19-Oct-2020 | 1.2 KiB | 41 | 35 | |
client.go | H A D | 19-Oct-2020 | 4.8 KiB | 140 | 99 | |
datastore.go | H A D | 19-Oct-2020 | 20.2 KiB | 682 | 501 | |
datastore_test.go | H A D | 19-Oct-2020 | 72.2 KiB | 3,573 | 3,315 | |
doc.go | H A D | 19-Oct-2020 | 16 KiB | 511 | 1 | |
errors.go | H A D | 19-Oct-2020 | 1.2 KiB | 48 | 25 | |
example_test.go | H A D | 19-Oct-2020 | 13.8 KiB | 594 | 442 | |
go.mod | H A D | 19-Oct-2020 | 389 | 15 | 12 | |
go.sum | H A D | 19-Oct-2020 | 51 KiB | 530 | 529 | |
go_mod_tidy_hack.go | H A D | 19-Oct-2020 | 920 | 23 | 2 | |
integration_test.go | H A D | 19-Oct-2020 | 32.8 KiB | 1,335 | 1,151 | |
key.go | H A D | 19-Oct-2020 | 7 KiB | 294 | 207 | |
key_test.go | H A D | 19-Oct-2020 | 4.9 KiB | 211 | 184 | |
keycompat.go | H A D | 19-Oct-2020 | 1.8 KiB | 67 | 38 | |
keycompat_test.go | H A D | 19-Oct-2020 | 1.7 KiB | 56 | 37 | |
load.go | H A D | 19-Oct-2020 | 14.6 KiB | 551 | 420 | |
load_test.go | H A D | 19-Oct-2020 | 24.9 KiB | 1,139 | 1,024 | |
mutation.go | H A D | 19-Oct-2020 | 3.6 KiB | 135 | 95 | |
mutation_test.go | H A D | 19-Oct-2020 | 3.5 KiB | 151 | 132 | |
oc_test.go | H A D | 19-Oct-2020 | 1.1 KiB | 44 | 23 | |
prop.go | H A D | 19-Oct-2020 | 9.5 KiB | 340 | 206 | |
query.go | H A D | 19-Oct-2020 | 22.5 KiB | 789 | 547 | |
query_test.go | H A D | 19-Oct-2020 | 14.3 KiB | 571 | 492 | |
save.go | H A D | 19-Oct-2020 | 13.7 KiB | 503 | 399 | |
save_test.go | H A D | 19-Oct-2020 | 8.7 KiB | 413 | 367 | |
time.go | H A D | 19-Oct-2020 | 1.2 KiB | 37 | 15 | |
time_test.go | H A D | 19-Oct-2020 | 2.4 KiB | 76 | 55 | |
transaction.go | H A D | 19-Oct-2020 | 12.9 KiB | 412 | 273 | |
transaction_test.go | H A D | 19-Oct-2020 | 2.1 KiB | 78 | 60 |
README.md
1## Cloud Datastore [![GoDoc](https://godoc.org/cloud.google.com/go/datastore?status.svg)](https://godoc.org/cloud.google.com/go/datastore) 2 3- [About Cloud Datastore](https://cloud.google.com/datastore/) 4- [Activating the API for your project](https://cloud.google.com/datastore/docs/activate) 5- [API documentation](https://cloud.google.com/datastore/docs) 6- [Go client documentation](https://godoc.org/cloud.google.com/go/datastore) 7- [Complete sample program](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/datastore/tasks) 8 9### Example Usage 10 11First create a `datastore.Client` to use throughout your application: 12 13[snip]:# (datastore-1) 14```go 15client, err := datastore.NewClient(ctx, "my-project-id") 16if err != nil { 17 log.Fatal(err) 18} 19``` 20 21Then use that client to interact with the API: 22 23[snip]:# (datastore-2) 24```go 25type Post struct { 26 Title string 27 Body string `datastore:",noindex"` 28 PublishedAt time.Time 29} 30keys := []*datastore.Key{ 31 datastore.NameKey("Post", "post1", nil), 32 datastore.NameKey("Post", "post2", nil), 33} 34posts := []*Post{ 35 {Title: "Post 1", Body: "...", PublishedAt: time.Now()}, 36 {Title: "Post 2", Body: "...", PublishedAt: time.Now()}, 37} 38if _, err := client.PutMulti(ctx, keys, posts); err != nil { 39 log.Fatal(err) 40} 41```