spanner

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

README

Spanner Datastore

This datastore implementation allows you to use a Google Cloud Spanner database as the backing durable storage for SpiceDB.

Usage Benefits

The Spanner datastore, like the CockroachDB datastore, can be used in highly scalable and multi-region installations.

Documentation

Index

Constants

View Source
const (
	CombinedChangeStreamName = "combined_change_stream"
)
View Source
const (
	Engine = "spanner"
)

Variables

Functions

func ContextualizedCaveatFrom added in v1.14.0

func ContextualizedCaveatFrom(name spanner.NullString, context spanner.NullJSON) (*core.ContextualizedCaveat, error)

func NewSpannerDatastore

func NewSpannerDatastore(ctx context.Context, database string, opts ...Option) (datastore.Datastore, error)

NewSpannerDatastore returns a datastore backed by cloud spanner

Types

type Option

type Option func(*spannerOptions)

Option provides the facility to configure how clients within the Spanner datastore interact with the running Spanner database.

func CredentialsFile

func CredentialsFile(path string) Option

CredentialsFile is the path to a file containing credentials for a service account that can access the cloud spanner instance

func DisableStats added in v1.18.0

func DisableStats(disable bool) Option

DisableStats disables recording counts to the stats table

func EmulatorHost added in v1.8.0

func EmulatorHost(uri string) Option

EmulatorHost is the URI of a Spanner emulator to connect to for development and testing use

func FollowerReadDelay

func FollowerReadDelay(delay time.Duration) Option

FollowerReadDelay is the time delay to apply to enable historial reads.

This value defaults to 0 seconds.

func MaxRevisionStalenessPercent

func MaxRevisionStalenessPercent(stalenessPercent float64) Option

MaxRevisionStalenessPercent is the amount of time, expressed as a percentage of the revision quantization window, that a previously computed rounded revision can still be advertised after the next rounded revision would otherwise be ready.

This value defaults to 0.1 (10%).

func MaxSessionCount added in v1.27.0

func MaxSessionCount(maxSessions uint64) Option

MaxSessionCount maximum number of session the Spanner client can have at a given time.

Defaults to 400 sessions.

func MigrationPhase added in v1.22.0

func MigrationPhase(phase string) Option

MigrationPhase configures the spanner driver to the proper state of a multi-phase migration.

Steady-state configuration (e.g. fully migrated) by default

func MinSessionCount added in v1.27.0

func MinSessionCount(minSessions uint64) Option

MinSessionCount minimum number of session the Spanner client can have at a given time.

Defaults to 100.

func ReadConnsMaxOpen added in v1.26.0

func ReadConnsMaxOpen(conns int) Option

ReadConnsMaxOpen is the maximum size of the connection pool used for reads.

This value defaults to having 20 connections.

func RevisionQuantization

func RevisionQuantization(bucketSize time.Duration) Option

RevisionQuantization is the time bucket size to which advertised revisions will be rounded.

This value defaults to 5 seconds.

func WatchBufferLength

func WatchBufferLength(watchBufferLength uint16) Option

WatchBufferLength is the number of entries that can be stored in the watch buffer while awaiting read by the client.

This value defaults to 128.

func WatchBufferWriteTimeout added in v1.29.0

func WatchBufferWriteTimeout(watchBufferWriteTimeout time.Duration) Option

WatchBufferWriteTimeout is the maximum timeout for writing to the watch buffer, after which the caller to the watch will be disconnected.

func WriteConnsMaxOpen added in v1.26.0

func WriteConnsMaxOpen(conns int) Option

WriteConnsMaxOpen is the maximum size of the connection pool used for writes.

This value defaults to having 10 connections.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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