spanner

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

Testing

In Memory

By default the tests in impl/spanner/... use an in-memory implementation of spanner that does not require any local setup.

Cloud Spanner Emulator

To test against a local docker instance of spanner, start the emulator and set environment flags.

gcloud beta emulators spanner start
$(gcloud beta emulators spanner env-init)

View and control the emulator with the gcloud command:

gcloud config configurations create emulator
gcloud config set auth/disable_credentials true
gcloud config set project fake-proj
gcloud config set api_endpoint_overrides/spanner http://localhost:9020/
gcloud config configurations activate emulator
gcloud spanner instances list
gcloud spanner databases list --instance fake-instance

Cloud Spanner

To test against an instance of spanner hosted in Google Cloud:

  1. Create a Spanner instance using the Google Cloud Console.
  2. Switch the gcloud configuration to default and authenticate.
unset SPANNER_EMULATOR_HOST
gcloud config configurations activate default
gcloud auth application-default login
go test ./impl/spanner/... -count 1 -args --fake_db=false --db_project=$GCP_PROJECT --db_instance=$INSTANCE_ID

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadDDL

func ReadDDL() ([]string, error)

ReadDDL returns a list of DDL statements for the KT database schema.

Types

This section is empty.

Directories

Path Synopsis
Package batch allows for reading and writing of batches of mutations.
Package batch allows for reading and writing of batches of mutations.
Package directory reads and writes Key Transparency Directory information.
Package directory reads and writes Key Transparency Directory information.
Package mutations stores mutations by timestamp.
Package mutations stores mutations by timestamp.
Package testutil helps with tests against Spanner.
Package testutil helps with tests against Spanner.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL