https://github.com/arran4/datastoreutils
Basic google cloud datastore helpers
https://github.com/arran4/datastoreutils
datastore go go-google-app-engine golang google-app-engine google-datastore library
Last synced: about 2 months ago
JSON representation
Basic google cloud datastore helpers
- Host: GitHub
- URL: https://github.com/arran4/datastoreutils
- Owner: arran4
- License: bsd-3-clause
- Created: 2020-02-11T10:48:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2026-04-14T06:52:54.000Z (2 months ago)
- Last Synced: 2026-04-14T08:32:30.580Z (2 months ago)
- Topics: datastore, go, go-google-app-engine, golang, google-app-engine, google-datastore, library
- Language: Go
- Homepage: https://pkg.go.dev/github.com/arran4/datastoreutils
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Utils
Currently just has key creation with namespace as a parameter.
Happy to add more.
### Usage
```go
// Using Must versions (panics on error)
key := dsutils.MustIncompleteKeyWithNamespace(model.OptionKind, "namespace", nil)
key := dsutils.MustNameKeyWithNamespace(model.OptionKind, "namespace", "Name", nil)
key := dsutils.MustIDKeyWithNamespace(model.OptionKind, "namespace", int64(Id), nil)
// Using error return versions
key, err := dsutils.IncompleteKeyWithNamespace(model.OptionKind, "namespace", nil)
if err != nil {
// handle error
}
key, err = dsutils.NameKeyWithNamespace(model.OptionKind, "namespace", "Name", nil)
if err != nil {
// handle error
}
key, err = dsutils.IDKeyWithNamespace(model.OptionKind, "namespace", int64(Id), nil)
if err != nil {
// handle error
}
```
### License
This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.