Skip to content

danny-yamamoto/go-spanner-example

Repository files navigation

go-spanner-example

Try Cloud Spanner and emulators. We will look into the development environment and CRUD in anticipation of the need for Cloud Spanner in the future. At this time, for us, Cloud Spanner is expensive. To keep development costs low, emulators are used.

flowchart LR
    docker["`docker
    emulator`"]
    devcontainer["`devcontainer
    Go`"]
    devcontainer -->|host.docker.internal:9020| docker

Usage

  • Start emulator.
docker pull gcr.io/cloud-spanner-emulator/emulator
docker run -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
curl http://host.docker.internal:9020
export SPANNER_EMULATOR_HOST=host.docker.internal:9010
echo $SPANNER_EMULATOR_HOST
curl --header "Content-Type: application/json" --data '{"singerId": 10}'     http://localhost:8080/singer.v1.SingerService/Singer

Reference

Releases

No releases published

Packages

No packages published