package
0.3.0
Repository: https://github.com/google/keytransparency.git
Documentation: pkg.go.dev

# 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

# Packages

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

# Functions

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