Documentation ¶
Index ¶
- Constants
- Variables
- func ContextualizedCaveatFrom(name spanner.NullString, context spanner.NullJSON) (*core.ContextualizedCaveat, error)
- func NewSpannerDatastore(ctx context.Context, database string, opts ...Option) (datastore.Datastore, error)
- type Option
- func CredentialsFile(path string) Option
- func DisableStats(disable bool) Option
- func EmulatorHost(uri string) Option
- func FollowerReadDelay(delay time.Duration) Option
- func MaxRevisionStalenessPercent(stalenessPercent float64) Option
- func MaxSessionCount(maxSessions uint64) Option
- func MigrationPhase(phase string) Option
- func MinSessionCount(minSessions uint64) Option
- func ReadConnsMaxOpen(conns int) Option
- func RevisionQuantization(bucketSize time.Duration) Option
- func WatchBufferLength(watchBufferLength uint16) Option
- func WatchBufferWriteTimeout(watchBufferWriteTimeout time.Duration) Option
- func WriteConnsMaxOpen(conns int) Option
Constants ¶
const (
CombinedChangeStreamName = "combined_change_stream"
)
const (
Engine = "spanner"
)
Variables ¶
var ParseRevisionString = revisions.RevisionParser(revisions.Timestamp)
Functions ¶
func ContextualizedCaveatFrom ¶ added in v1.14.0
func ContextualizedCaveatFrom(name spanner.NullString, context spanner.NullJSON) (*core.ContextualizedCaveat, error)
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 ¶
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
DisableStats disables recording counts to the stats table
func EmulatorHost ¶ added in v1.8.0
EmulatorHost is the URI of a Spanner emulator to connect to for development and testing use
func FollowerReadDelay ¶
FollowerReadDelay is the time delay to apply to enable historial reads.
This value defaults to 0 seconds.
func MaxRevisionStalenessPercent ¶
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
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
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
MinSessionCount minimum number of session the Spanner client can have at a given time.
Defaults to 100.
func ReadConnsMaxOpen ¶ added in v1.26.0
ReadConnsMaxOpen is the maximum size of the connection pool used for reads.
This value defaults to having 20 connections.
func RevisionQuantization ¶
RevisionQuantization is the time bucket size to which advertised revisions will be rounded.
This value defaults to 5 seconds.
func WatchBufferLength ¶
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
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
WriteConnsMaxOpen is the maximum size of the connection pool used for writes.
This value defaults to having 10 connections.