spanner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

GCP Spanner backend for a vanity store

Documentation

Overview

Package spanner contains the GCP Spanner Backend.

Index

Constants

View Source
const (

	// DefaultTable is the default Spanner table name.
	DefaultTable = "urls"

	// DefaultNumChannels is the default number of channels in the Spanner client.
	DefaultNumChannels = 10
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, database string, opts ...BackendOption) (api vanity.Backend, err error)

NewClient creates a client to a database. A valid database name has the form projects/PROJECT_ID/instances/INSTANCE_ID/databases/DATABASE_ID.

Types

type BackendOption

type BackendOption interface {
	Apply(*backendSettings)
}

A BackendOption is an option for a Spanner-based backend.

func WithClientConfig

func WithClientConfig(c spanner.ClientConfig) BackendOption

WithClientConfig returns a BackendOption that specifies configurations for the Spanner client.

func WithClientOptions

func WithClientOptions(o []option.ClientOption) BackendOption

WithClientOptions returns a BackendOption that specifies Google API client configurations for the Spanner client.

func WithTable

func WithTable(t string) BackendOption

WithTable configures the Spanner table; default is "urls".

Jump to

Keyboard shortcuts

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