{"id":16808995,"url":"https://github.com/timakin/gosto","last_synced_at":"2025-10-05T18:30:12.558Z","repository":{"id":68621622,"uuid":"102478385","full_name":"timakin/gosto","owner":"timakin","description":"Google Cloud Datastore Client Wrapper in Go, for automation of key attachment.","archived":false,"fork":false,"pushed_at":"2017-09-20T14:45:47.000Z","size":46,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T22:17:09.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timakin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-05T12:27:29.000Z","updated_at":"2019-10-16T15:58:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"3063a344-054d-47a1-9f2b-c21d7e648c8c","html_url":"https://github.com/timakin/gosto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fgosto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fgosto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fgosto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timakin%2Fgosto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timakin","download_url":"https://codeload.github.com/timakin/gosto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248323142,"owners_count":21084451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T10:00:33.195Z","updated_at":"2025-10-05T18:30:07.510Z","avatar_url":"https://github.com/timakin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gosto\n----\n\nGoogle Cloud Datastore Client Wrapper in Go, for automation of key attachment.\n\nFor example, inside of GKE container, you can access to datastore API of you're authorized with Service Account.\n\n## Table of Contents\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Supported API](#supported-api)\n- [Using the library](#using-the-library)\n  - [Quick start](#quick-start)\n  - [Get](#get)\n  - [GetMulti](#get-multi)\n  - [Delete](#delete)\n  - [DeleteMulti](#delete-multi)\n  - [Put](#put)\n  - [PutMulti](#put-multi)\n  - [RunInTransaction](#run-in-transaction)\n  \n\u003c!-- /MarkdownTOC --\u003e\n\n## Supported API\n\n- Get\n- GetMulti\n- Delete\n- DeleteMulti\n- Put\n- PutMulti\n- RunInTransaction\n\n## Using the library\n\n### Quick Start\n\nA client of gosto can be used with `context.Context` and Google Cloud Platform's `project-id`.\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\n```\n\n### Get\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nuser := \u0026User{\n    ID: 1,\n}\nif err = client.Get(user); err != nil {\n    ...\n}\n```\n\n### GetMulti\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nusers := []*User{\n    \u0026User{\n        ID: 1,\n    },\n    \u0026User{\n        ID: 2,\n    },\n}\nif err = client.GetMulti(users); err != nil {\n    ...\n}\n```\n\n### Delete\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nuser := \u0026User{\n    ID: 1,\n    ...\n}\n\nkey := client.Key(user)\nif err = client.Delete(key); err != nil {\n    ...\n}\n```\n\n### DeleteMulti\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nusers := []*User{\n    \u0026User{\n        ID: 1,\n    },\n    \u0026User{\n        ID: 2,\n    },\n}\n\nvar keys []*datastore.Key\nfor i := range users {\n    user := users[i]\n    keys = append(keys, client.Key(user))\n}\n\nif err = client.DeleteMulti(keys); err != nil {\n    ...\n}\n```\n\n### Put\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nuser := \u0026User{\n    Name: \"John Doe\",\n}\n\nif key, err = client.Put(user); err != nil {\n    ...\n}\n```\n\n### PutMulti\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nusers := []*User{\n    \u0026User{\n        Name: \"John Doe\",\n    },\n    \u0026User{\n        Name: \"Jane Doe\",\n    },\n}\n\n\nif keys, err = client.PutMulti(users); err != nil {\n    ...\n}\n```\n\n### RunInTransaction\n\n```\nclient, err := gosto.NewGosto(ctx, \"project-id\")\nif err != nil {\n    ...\n}\n\nif err = client.RunInTransaction(func(tx *datastore.Transaction) error {\n    user := \u0026User{\n        Name: \"John Doe\",\n    }\n    uKey := client.Key(user)\n\tif err := tx.Put(uKey, user); err != nil \u0026\u0026 err != datastore.ErrNoSuchEntity {\n\t\treturn err\n\t}\n    prof := \u0026UserProfile{\n        UserID: user.ID,\n        Content: \"HogeFuga\",\n    }\n    pKey := client.Key(prof)\n\tif _, err := tx.Put(pKey, prof); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimakin%2Fgosto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimakin%2Fgosto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimakin%2Fgosto/lists"}