Documentation
¶
Overview ¶
Package dsconfig holds the configuration type for constructing datastores by engine name, along with the registry of engine builders. It is a leaf package with minimal dependencies so that datastore engine packages can import it to register themselves without creating import cycles; pkg/cmd/datastore re-exports everything here and provides flag registration and NewDatastore on top.
Code generated by github.com/ecordell/optgen. DO NOT EDIT.
Code generated by github.com/ecordell/optgen. DO NOT EDIT.
Code generated by github.com/ecordell/optgen. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func RegisterEngine(engineName string, builder EngineBuilderFunc)
- type Config
- type ConfigOption
- func SetAllowedMigrations(allowedMigrations []string) ConfigOption
- func SetBootstrapFileContents(bootstrapFileContents map[string][]byte) ConfigOption
- func SetBootstrapFiles(bootstrapFiles []string) ConfigOption
- func SetReadReplicaURIs(readReplicaURIs []string) ConfigOption
- func SetRelationshipIntegrityExpiredKeys(relationshipIntegrityExpiredKeys []string) ConfigOption
- func SetSpannerCredentialsJSON(spannerCredentialsJSON []byte) ConfigOption
- func WithAllowedMigrations(allowedMigrations string) ConfigOption
- func WithBootstrapFileContents(key string, value []byte) ConfigOption
- func WithBootstrapFiles(bootstrapFiles string) ConfigOption
- func WithBootstrapOverwrite(bootstrapOverwrite bool) ConfigOption
- func WithBootstrapSchemaMode(bootstrapSchemaMode schemamode.SchemaMode) ConfigOption
- func WithBootstrapTimeout(bootstrapTimeout time.Duration) ConfigOption
- func WithCaveatTypeSet(caveatTypeSet *types.TypeSet) ConfigOption
- func WithConnectRate(connectRate time.Duration) ConfigOption
- func WithCredentialsProviderName(credentialsProviderName string) ConfigOption
- func WithDisableStats(disableStats bool) ConfigOption
- func WithDisableWatchSupport(disableWatchSupport bool) ConfigOption
- func WithEnableConnectionBalancing(enableConnectionBalancing bool) ConfigOption
- func WithEnableDatastoreMetrics(enableDatastoreMetrics bool) ConfigOption
- func WithEnableRevisionHeartbeat(enableRevisionHeartbeat bool) ConfigOption
- func WithEngine(engine string) ConfigOption
- func WithExperimentalColumnOptimization(experimentalColumnOptimization bool) ConfigOption
- func WithFilterMaximumIDCount(filterMaximumIDCount uint16) ConfigOption
- func WithFollowerReadDelay(followerReadDelay time.Duration) ConfigOption
- func WithGCInterval(gCInterval time.Duration) ConfigOption
- func WithGCMaxOperationTime(gCMaxOperationTime time.Duration) ConfigOption
- func WithGCWindow(gCWindow time.Duration) ConfigOption
- func WithIncludeQueryParametersInTraces(includeQueryParametersInTraces bool) ConfigOption
- func WithLegacyFuzzing(legacyFuzzing time.Duration) ConfigOption
- func WithMaxRetries(maxRetries int) ConfigOption
- func WithMaxRevisionStalenessPercent(maxRevisionStalenessPercent float64) ConfigOption
- func WithMigrationPhase(migrationPhase string) ConfigOption
- func WithOldReadReplicaConnPool(oldReadReplicaConnPool ConnPoolConfig) ConfigOption
- func WithOverlapKey(overlapKey string) ConfigOption
- func WithOverlapStrategy(overlapStrategy string) ConfigOption
- func WithReadConnPool(readConnPool ConnPoolConfig) ConfigOption
- func WithReadOnly(readOnly bool) ConfigOption
- func WithReadReplicaConnPool(readReplicaConnPool ConnPoolConfig) ConfigOption
- func WithReadReplicaCredentialsProviderName(readReplicaCredentialsProviderName string) ConfigOption
- func WithReadReplicaURIs(readReplicaURIs string) ConfigOption
- func WithRelationshipIntegrityCurrentKey(relationshipIntegrityCurrentKey RelIntegrityKey) ConfigOption
- func WithRelationshipIntegrityEnabled(relationshipIntegrityEnabled bool) ConfigOption
- func WithRelationshipIntegrityExpiredKeys(relationshipIntegrityExpiredKeys string) ConfigOption
- func WithRelaxedIsolationLevel(relaxedIsolationLevel bool) ConfigOption
- func WithRequestHedgingEnabled(requestHedgingEnabled bool) ConfigOption
- func WithRequestHedgingInitialSlowValue(requestHedgingInitialSlowValue time.Duration) ConfigOption
- func WithRequestHedgingMaxRequests(requestHedgingMaxRequests uint64) ConfigOption
- func WithRequestHedgingQuantile(requestHedgingQuantile float64) ConfigOption
- func WithRevisionQuantization(revisionQuantization time.Duration) ConfigOption
- func WithSpannerCredentialsFile(spannerCredentialsFile string) ConfigOption
- func WithSpannerCredentialsJSON(spannerCredentialsJSON byte) ConfigOption
- func WithSpannerDatastoreMetricsOption(spannerDatastoreMetricsOption string) ConfigOption
- func WithSpannerEmulatorHost(spannerEmulatorHost string) ConfigOption
- func WithSpannerMaxSessions(spannerMaxSessions uint64) ConfigOption
- func WithSpannerMinSessions(spannerMinSessions uint64) ConfigOption
- func WithTablePrefix(tablePrefix string) ConfigOption
- func WithURI(uRI string) ConfigOption
- func WithWatchBufferLength(watchBufferLength uint16) ConfigOption
- func WithWatchBufferWriteTimeout(watchBufferWriteTimeout time.Duration) ConfigOption
- func WithWatchChangeBufferMaximumSize(watchChangeBufferMaximumSize string) ConfigOption
- func WithWatchConnectTimeout(watchConnectTimeout time.Duration) ConfigOption
- func WithWriteAcquisitionTimeout(writeAcquisitionTimeout time.Duration) ConfigOption
- func WithWriteConnPool(writeConnPool ConnPoolConfig) ConfigOption
- type ConnPoolConfig
- func ConnPoolConfigWithOptions(c *ConnPoolConfig, opts ...ConnPoolConfigOption) *ConnPoolConfig
- func DefaultReadConnPool() *ConnPoolConfig
- func DefaultWriteConnPool() *ConnPoolConfig
- func NewConnPoolConfigWithOptions(opts ...ConnPoolConfigOption) *ConnPoolConfig
- func NewConnPoolConfigWithOptionsAndDefaults(opts ...ConnPoolConfigOption) *ConnPoolConfig
- type ConnPoolConfigOption
- func WithHealthCheckInterval(healthCheckInterval time.Duration) ConnPoolConfigOption
- func WithMaxIdleTime(maxIdleTime time.Duration) ConnPoolConfigOption
- func WithMaxLifetime(maxLifetime time.Duration) ConnPoolConfigOption
- func WithMaxLifetimeJitter(maxLifetimeJitter time.Duration) ConnPoolConfigOption
- func WithMaxOpenConns(maxOpenConns int) ConnPoolConfigOption
- func WithMinOpenConns(minOpenConns int) ConnPoolConfigOption
- func WithPingTimeout(pingTimeout time.Duration) ConnPoolConfigOption
- type EngineBuilderFunc
- type RelIntegrityKey
- type RelIntegrityKeyOption
Constants ¶
const ( MaxReplicaCount = 16 DefaultFollowerReadDelay = 4_800 * time.Millisecond )
const ( MemoryEngine = "memory" PostgresEngine = "postgres" CockroachEngine = "cockroachdb" SpannerEngine = "spanner" MySQLEngine = "mysql" )
Variables ¶
var BuilderForEngine = map[string]EngineBuilderFunc{}
BuilderForEngine holds the builder for each datastore engine, keyed by engine name. Engines register themselves via RegisterEngine from an init function; importing an engine package makes it available to pkg/cmd/datastore.NewDatastore. pkg/cmd/datastore links every engine defined in this repository, so those are always available.
Functions ¶
func RegisterEngine ¶
func RegisterEngine(engineName string, builder EngineBuilderFunc)
RegisterEngine makes a datastore engine available to pkg/cmd/datastore.NewDatastore under the given name. It is typically called from an init function of the package defining the engine.
Types ¶
type Config ¶
type Config struct {
Engine string `debugmap:"visible" default:"memory"`
URI string `debugmap:"sensitive"`
GCWindow time.Duration `debugmap:"visible" default:"24h"`
LegacyFuzzing time.Duration `debugmap:"visible" default:"-1ns"`
RevisionQuantization time.Duration `debugmap:"visible" default:"5s"`
MaxRevisionStalenessPercent float64 `debugmap:"visible" default:"0.1"`
CredentialsProviderName string `debugmap:"visible"`
FilterMaximumIDCount uint16 `debugmap:"hidden" default:"100"`
// Options
ReadConnPool ConnPoolConfig `debugmap:"visible"`
WriteConnPool ConnPoolConfig `debugmap:"visible"`
ReadOnly bool `debugmap:"visible"`
EnableDatastoreMetrics bool `debugmap:"visible" default:"true"`
DisableStats bool `debugmap:"visible"`
IncludeQueryParametersInTraces bool `debugmap:"visible"`
// Read Replicas
ReadReplicaConnPool ConnPoolConfig `debugmap:"visible"`
// this holds values from the old flag prefix in case they are used
OldReadReplicaConnPool ConnPoolConfig `debugmap:"hidden"`
ReadReplicaURIs []string `debugmap:"sensitive"`
ReadReplicaCredentialsProviderName string `debugmap:"visible"`
// Bootstrap
BootstrapFiles []string `debugmap:"visible-format"`
BootstrapFileContents map[string][]byte `debugmap:"visible"`
BootstrapOverwrite bool `debugmap:"visible"`
BootstrapTimeout time.Duration `debugmap:"visible" default:"10s"`
CaveatTypeSet *caveattypes.TypeSet `debugmap:"hidden"`
// BootstrapSchemaMode controls the schema storage mode used when writing bootstrap
// data. The zero value (SchemaModeReadLegacyWriteLegacy) preserves prior behavior.
BootstrapSchemaMode schemamode.SchemaMode `debugmap:"visible"`
// Hedging
RequestHedgingEnabled bool `debugmap:"visible"`
RequestHedgingInitialSlowValue time.Duration `debugmap:"visible"`
RequestHedgingMaxRequests uint64 `debugmap:"visible"`
RequestHedgingQuantile float64 `debugmap:"visible"`
// CRDB
FollowerReadDelay time.Duration `debugmap:"visible" default:"4800ms"`
MaxRetries int `debugmap:"visible" default:"10"`
OverlapKey string `debugmap:"visible" default:"key"`
OverlapStrategy string `debugmap:"visible" default:"static"`
EnableConnectionBalancing bool `debugmap:"visible" default:"true"`
ConnectRate time.Duration `debugmap:"visible" default:"100ms"`
WriteAcquisitionTimeout time.Duration `debugmap:"visible" default:"30ms"`
// Postgres
GCInterval time.Duration `debugmap:"visible" default:"3m"`
GCMaxOperationTime time.Duration `debugmap:"visible" default:"1m"`
RelaxedIsolationLevel bool `debugmap:"visible"`
// Spanner
// SpannerCredentialsFile is a filename reference to a file containing
// spanner client credentials.
//
// Deprecated: Prefer Application Default Credentials for Spanner client credentials:
// https://docs.cloud.google.com/docs/authentication/client-libraries#adc
SpannerCredentialsFile string `debugmap:"visible"`
// SpannerCredentialsJSON is a mechanism for providing client configuration as JSON.
//
// Deprecated: Prefer Application Default Credentials for Spanner client credentials:
// https://docs.cloud.google.com/docs/authentication/client-libraries#adc
SpannerCredentialsJSON []byte `debugmap:"sensitive"`
SpannerEmulatorHost string `debugmap:"visible"`
SpannerMinSessions uint64 `debugmap:"visible" default:"100"`
SpannerMaxSessions uint64 `debugmap:"visible" default:"400"`
SpannerDatastoreMetricsOption string `debugmap:"visible" default:"otel"`
// MySQL
TablePrefix string `debugmap:"visible"`
// Relationship Integrity
RelationshipIntegrityEnabled bool `debugmap:"visible"`
RelationshipIntegrityCurrentKey RelIntegrityKey `debugmap:"visible"`
RelationshipIntegrityExpiredKeys []string `debugmap:"visible"`
// Internal
WatchBufferLength uint16 `debugmap:"visible" default:"1024"`
WatchChangeBufferMaximumSize string `debugmap:"visible" default:"15%"`
WatchBufferWriteTimeout time.Duration `debugmap:"visible" default:"1s"`
WatchConnectTimeout time.Duration `debugmap:"visible" default:"1s"`
DisableWatchSupport bool `debugmap:"hidden"`
// Migrations
MigrationPhase string `debugmap:"visible"`
AllowedMigrations []string `debugmap:"visible"`
// Experimental
ExperimentalColumnOptimization bool `debugmap:"visible" default:"true"`
EnableRevisionHeartbeat bool `debugmap:"visible"`
}
func ConfigWithOptions ¶
func ConfigWithOptions(c *Config, opts ...ConfigOption) *Config
ConfigWithOptions configures an existing Config with the passed in options set
func DefaultDatastoreConfig ¶
func DefaultDatastoreConfig() *Config
func NewConfigWithOptions ¶
func NewConfigWithOptions(opts ...ConfigOption) *Config
NewConfigWithOptions creates a new Config with the passed in options set
func NewConfigWithOptionsAndDefaults ¶
func NewConfigWithOptionsAndDefaults(opts ...ConfigOption) *Config
NewConfigWithOptionsAndDefaults creates a new Config with the passed in options set starting from the defaults
func (*Config) FlatDebugMap ¶
FlatDebugMap returns a flattened map form of Config for debugging Nested maps are flattened using dot notation (e.g., "parent.child.field")
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults is invoked by github.com/creasty/defaults after struct-tag defaults are applied. It fills the four ConnPoolConfig slots from the canonical DefaultReadConnPool / DefaultWriteConnPool constructors because each slot receives a different default set from RegisterConnPoolFlagsWithPrefix in RegisterDatastoreFlagsWithPrefix (Read pools = 20/20 conns, Write = 10/10). It also pre-allocates slice fields to empty (non-nil) values so the resulting Config matches what RegisterDatastoreFlags writes via StringSliceVar/StringArrayVar.
func (*Config) ToOption ¶
func (c *Config) ToOption() ConfigOption
ToOption returns a new ConfigOption that sets the values from the passed in Config
func (*Config) WithOptions ¶
func (c *Config) WithOptions(opts ...ConfigOption) *Config
WithOptions configures the receiver Config with the passed in options set
type ConfigOption ¶
type ConfigOption func(c *Config)
func SetAllowedMigrations ¶
func SetAllowedMigrations(allowedMigrations []string) ConfigOption
SetAllowedMigrations returns an option that can set AllowedMigrations on a Config
func SetBootstrapFileContents ¶
func SetBootstrapFileContents(bootstrapFileContents map[string][]byte) ConfigOption
SetBootstrapFileContents returns an option that can set BootstrapFileContents on a Config
func SetBootstrapFiles ¶
func SetBootstrapFiles(bootstrapFiles []string) ConfigOption
SetBootstrapFiles returns an option that can set BootstrapFiles on a Config
func SetReadReplicaURIs ¶
func SetReadReplicaURIs(readReplicaURIs []string) ConfigOption
SetReadReplicaURIs returns an option that can set ReadReplicaURIs on a Config
func SetRelationshipIntegrityExpiredKeys ¶
func SetRelationshipIntegrityExpiredKeys(relationshipIntegrityExpiredKeys []string) ConfigOption
SetRelationshipIntegrityExpiredKeys returns an option that can set RelationshipIntegrityExpiredKeys on a Config
func SetSpannerCredentialsJSON ¶
func SetSpannerCredentialsJSON(spannerCredentialsJSON []byte) ConfigOption
SetSpannerCredentialsJSON returns an option that can set SpannerCredentialsJSON on a Config
func WithAllowedMigrations ¶
func WithAllowedMigrations(allowedMigrations string) ConfigOption
WithAllowedMigrations returns an option that can append AllowedMigrationss to Config.AllowedMigrations
func WithBootstrapFileContents ¶
func WithBootstrapFileContents(key string, value []byte) ConfigOption
WithBootstrapFileContents returns an option that can append BootstrapFileContentss to Config.BootstrapFileContents
func WithBootstrapFiles ¶
func WithBootstrapFiles(bootstrapFiles string) ConfigOption
WithBootstrapFiles returns an option that can append BootstrapFiless to Config.BootstrapFiles
func WithBootstrapOverwrite ¶
func WithBootstrapOverwrite(bootstrapOverwrite bool) ConfigOption
WithBootstrapOverwrite returns an option that can set BootstrapOverwrite on a Config
func WithBootstrapSchemaMode ¶
func WithBootstrapSchemaMode(bootstrapSchemaMode schemamode.SchemaMode) ConfigOption
WithBootstrapSchemaMode returns an option that can set BootstrapSchemaMode on a Config
func WithBootstrapTimeout ¶
func WithBootstrapTimeout(bootstrapTimeout time.Duration) ConfigOption
WithBootstrapTimeout returns an option that can set BootstrapTimeout on a Config
func WithCaveatTypeSet ¶
func WithCaveatTypeSet(caveatTypeSet *types.TypeSet) ConfigOption
WithCaveatTypeSet returns an option that can set CaveatTypeSet on a Config
func WithConnectRate ¶
func WithConnectRate(connectRate time.Duration) ConfigOption
WithConnectRate returns an option that can set ConnectRate on a Config
func WithCredentialsProviderName ¶
func WithCredentialsProviderName(credentialsProviderName string) ConfigOption
WithCredentialsProviderName returns an option that can set CredentialsProviderName on a Config
func WithDisableStats ¶
func WithDisableStats(disableStats bool) ConfigOption
WithDisableStats returns an option that can set DisableStats on a Config
func WithDisableWatchSupport ¶
func WithDisableWatchSupport(disableWatchSupport bool) ConfigOption
WithDisableWatchSupport returns an option that can set DisableWatchSupport on a Config
func WithEnableConnectionBalancing ¶
func WithEnableConnectionBalancing(enableConnectionBalancing bool) ConfigOption
WithEnableConnectionBalancing returns an option that can set EnableConnectionBalancing on a Config
func WithEnableDatastoreMetrics ¶
func WithEnableDatastoreMetrics(enableDatastoreMetrics bool) ConfigOption
WithEnableDatastoreMetrics returns an option that can set EnableDatastoreMetrics on a Config
func WithEnableRevisionHeartbeat ¶
func WithEnableRevisionHeartbeat(enableRevisionHeartbeat bool) ConfigOption
WithEnableRevisionHeartbeat returns an option that can set EnableRevisionHeartbeat on a Config
func WithEngine ¶
func WithEngine(engine string) ConfigOption
WithEngine returns an option that can set Engine on a Config
func WithExperimentalColumnOptimization ¶
func WithExperimentalColumnOptimization(experimentalColumnOptimization bool) ConfigOption
WithExperimentalColumnOptimization returns an option that can set ExperimentalColumnOptimization on a Config
func WithFilterMaximumIDCount ¶
func WithFilterMaximumIDCount(filterMaximumIDCount uint16) ConfigOption
WithFilterMaximumIDCount returns an option that can set FilterMaximumIDCount on a Config
func WithFollowerReadDelay ¶
func WithFollowerReadDelay(followerReadDelay time.Duration) ConfigOption
WithFollowerReadDelay returns an option that can set FollowerReadDelay on a Config
func WithGCInterval ¶
func WithGCInterval(gCInterval time.Duration) ConfigOption
WithGCInterval returns an option that can set GCInterval on a Config
func WithGCMaxOperationTime ¶
func WithGCMaxOperationTime(gCMaxOperationTime time.Duration) ConfigOption
WithGCMaxOperationTime returns an option that can set GCMaxOperationTime on a Config
func WithGCWindow ¶
func WithGCWindow(gCWindow time.Duration) ConfigOption
WithGCWindow returns an option that can set GCWindow on a Config
func WithIncludeQueryParametersInTraces ¶
func WithIncludeQueryParametersInTraces(includeQueryParametersInTraces bool) ConfigOption
WithIncludeQueryParametersInTraces returns an option that can set IncludeQueryParametersInTraces on a Config
func WithLegacyFuzzing ¶
func WithLegacyFuzzing(legacyFuzzing time.Duration) ConfigOption
WithLegacyFuzzing returns an option that can set LegacyFuzzing on a Config
func WithMaxRetries ¶
func WithMaxRetries(maxRetries int) ConfigOption
WithMaxRetries returns an option that can set MaxRetries on a Config
func WithMaxRevisionStalenessPercent ¶
func WithMaxRevisionStalenessPercent(maxRevisionStalenessPercent float64) ConfigOption
WithMaxRevisionStalenessPercent returns an option that can set MaxRevisionStalenessPercent on a Config
func WithMigrationPhase ¶
func WithMigrationPhase(migrationPhase string) ConfigOption
WithMigrationPhase returns an option that can set MigrationPhase on a Config
func WithOldReadReplicaConnPool ¶
func WithOldReadReplicaConnPool(oldReadReplicaConnPool ConnPoolConfig) ConfigOption
WithOldReadReplicaConnPool returns an option that can set OldReadReplicaConnPool on a Config
func WithOverlapKey ¶
func WithOverlapKey(overlapKey string) ConfigOption
WithOverlapKey returns an option that can set OverlapKey on a Config
func WithOverlapStrategy ¶
func WithOverlapStrategy(overlapStrategy string) ConfigOption
WithOverlapStrategy returns an option that can set OverlapStrategy on a Config
func WithReadConnPool ¶
func WithReadConnPool(readConnPool ConnPoolConfig) ConfigOption
WithReadConnPool returns an option that can set ReadConnPool on a Config
func WithReadOnly ¶
func WithReadOnly(readOnly bool) ConfigOption
WithReadOnly returns an option that can set ReadOnly on a Config
func WithReadReplicaConnPool ¶
func WithReadReplicaConnPool(readReplicaConnPool ConnPoolConfig) ConfigOption
WithReadReplicaConnPool returns an option that can set ReadReplicaConnPool on a Config
func WithReadReplicaCredentialsProviderName ¶
func WithReadReplicaCredentialsProviderName(readReplicaCredentialsProviderName string) ConfigOption
WithReadReplicaCredentialsProviderName returns an option that can set ReadReplicaCredentialsProviderName on a Config
func WithReadReplicaURIs ¶
func WithReadReplicaURIs(readReplicaURIs string) ConfigOption
WithReadReplicaURIs returns an option that can append ReadReplicaURIss to Config.ReadReplicaURIs
func WithRelationshipIntegrityCurrentKey ¶
func WithRelationshipIntegrityCurrentKey(relationshipIntegrityCurrentKey RelIntegrityKey) ConfigOption
WithRelationshipIntegrityCurrentKey returns an option that can set RelationshipIntegrityCurrentKey on a Config
func WithRelationshipIntegrityEnabled ¶
func WithRelationshipIntegrityEnabled(relationshipIntegrityEnabled bool) ConfigOption
WithRelationshipIntegrityEnabled returns an option that can set RelationshipIntegrityEnabled on a Config
func WithRelationshipIntegrityExpiredKeys ¶
func WithRelationshipIntegrityExpiredKeys(relationshipIntegrityExpiredKeys string) ConfigOption
WithRelationshipIntegrityExpiredKeys returns an option that can append RelationshipIntegrityExpiredKeyss to Config.RelationshipIntegrityExpiredKeys
func WithRelaxedIsolationLevel ¶
func WithRelaxedIsolationLevel(relaxedIsolationLevel bool) ConfigOption
WithRelaxedIsolationLevel returns an option that can set RelaxedIsolationLevel on a Config
func WithRequestHedgingEnabled ¶
func WithRequestHedgingEnabled(requestHedgingEnabled bool) ConfigOption
WithRequestHedgingEnabled returns an option that can set RequestHedgingEnabled on a Config
func WithRequestHedgingInitialSlowValue ¶
func WithRequestHedgingInitialSlowValue(requestHedgingInitialSlowValue time.Duration) ConfigOption
WithRequestHedgingInitialSlowValue returns an option that can set RequestHedgingInitialSlowValue on a Config
func WithRequestHedgingMaxRequests ¶
func WithRequestHedgingMaxRequests(requestHedgingMaxRequests uint64) ConfigOption
WithRequestHedgingMaxRequests returns an option that can set RequestHedgingMaxRequests on a Config
func WithRequestHedgingQuantile ¶
func WithRequestHedgingQuantile(requestHedgingQuantile float64) ConfigOption
WithRequestHedgingQuantile returns an option that can set RequestHedgingQuantile on a Config
func WithRevisionQuantization ¶
func WithRevisionQuantization(revisionQuantization time.Duration) ConfigOption
WithRevisionQuantization returns an option that can set RevisionQuantization on a Config
func WithSpannerCredentialsFile ¶
func WithSpannerCredentialsFile(spannerCredentialsFile string) ConfigOption
WithSpannerCredentialsFile returns an option that can set SpannerCredentialsFile on a Config
func WithSpannerCredentialsJSON ¶
func WithSpannerCredentialsJSON(spannerCredentialsJSON byte) ConfigOption
WithSpannerCredentialsJSON returns an option that can append SpannerCredentialsJSONs to Config.SpannerCredentialsJSON
func WithSpannerDatastoreMetricsOption ¶
func WithSpannerDatastoreMetricsOption(spannerDatastoreMetricsOption string) ConfigOption
WithSpannerDatastoreMetricsOption returns an option that can set SpannerDatastoreMetricsOption on a Config
func WithSpannerEmulatorHost ¶
func WithSpannerEmulatorHost(spannerEmulatorHost string) ConfigOption
WithSpannerEmulatorHost returns an option that can set SpannerEmulatorHost on a Config
func WithSpannerMaxSessions ¶
func WithSpannerMaxSessions(spannerMaxSessions uint64) ConfigOption
WithSpannerMaxSessions returns an option that can set SpannerMaxSessions on a Config
func WithSpannerMinSessions ¶
func WithSpannerMinSessions(spannerMinSessions uint64) ConfigOption
WithSpannerMinSessions returns an option that can set SpannerMinSessions on a Config
func WithTablePrefix ¶
func WithTablePrefix(tablePrefix string) ConfigOption
WithTablePrefix returns an option that can set TablePrefix on a Config
func WithURI ¶
func WithURI(uRI string) ConfigOption
WithURI returns an option that can set URI on a Config
func WithWatchBufferLength ¶
func WithWatchBufferLength(watchBufferLength uint16) ConfigOption
WithWatchBufferLength returns an option that can set WatchBufferLength on a Config
func WithWatchBufferWriteTimeout ¶
func WithWatchBufferWriteTimeout(watchBufferWriteTimeout time.Duration) ConfigOption
WithWatchBufferWriteTimeout returns an option that can set WatchBufferWriteTimeout on a Config
func WithWatchChangeBufferMaximumSize ¶
func WithWatchChangeBufferMaximumSize(watchChangeBufferMaximumSize string) ConfigOption
WithWatchChangeBufferMaximumSize returns an option that can set WatchChangeBufferMaximumSize on a Config
func WithWatchConnectTimeout ¶
func WithWatchConnectTimeout(watchConnectTimeout time.Duration) ConfigOption
WithWatchConnectTimeout returns an option that can set WatchConnectTimeout on a Config
func WithWriteAcquisitionTimeout ¶
func WithWriteAcquisitionTimeout(writeAcquisitionTimeout time.Duration) ConfigOption
WithWriteAcquisitionTimeout returns an option that can set WriteAcquisitionTimeout on a Config
func WithWriteConnPool ¶
func WithWriteConnPool(writeConnPool ConnPoolConfig) ConfigOption
WithWriteConnPool returns an option that can set WriteConnPool on a Config
type ConnPoolConfig ¶
type ConnPoolConfig struct {
MaxIdleTime time.Duration `debugmap:"visible" default:"30m"`
MaxLifetime time.Duration `debugmap:"visible" default:"30m"`
MaxLifetimeJitter time.Duration `debugmap:"visible"`
MaxOpenConns int `debugmap:"visible"`
MinOpenConns int `debugmap:"visible"`
HealthCheckInterval time.Duration `debugmap:"visible" default:"30s"`
PingTimeout time.Duration `debugmap:"visible" default:"5s"`
}
func ConnPoolConfigWithOptions ¶
func ConnPoolConfigWithOptions(c *ConnPoolConfig, opts ...ConnPoolConfigOption) *ConnPoolConfig
ConnPoolConfigWithOptions configures an existing ConnPoolConfig with the passed in options set
func DefaultReadConnPool ¶
func DefaultReadConnPool() *ConnPoolConfig
func DefaultWriteConnPool ¶
func DefaultWriteConnPool() *ConnPoolConfig
func NewConnPoolConfigWithOptions ¶
func NewConnPoolConfigWithOptions(opts ...ConnPoolConfigOption) *ConnPoolConfig
NewConnPoolConfigWithOptions creates a new ConnPoolConfig with the passed in options set
func NewConnPoolConfigWithOptionsAndDefaults ¶
func NewConnPoolConfigWithOptionsAndDefaults(opts ...ConnPoolConfigOption) *ConnPoolConfig
NewConnPoolConfigWithOptionsAndDefaults creates a new ConnPoolConfig with the passed in options set starting from the defaults
func (*ConnPoolConfig) DebugMap ¶
func (c *ConnPoolConfig) DebugMap() map[string]any
DebugMap returns a map form of ConnPoolConfig for debugging
func (*ConnPoolConfig) FlatDebugMap ¶
func (c *ConnPoolConfig) FlatDebugMap() map[string]any
FlatDebugMap returns a flattened map form of ConnPoolConfig for debugging Nested maps are flattened using dot notation (e.g., "parent.child.field")
func (*ConnPoolConfig) ToOption ¶
func (c *ConnPoolConfig) ToOption() ConnPoolConfigOption
ToOption returns a new ConnPoolConfigOption that sets the values from the passed in ConnPoolConfig
func (*ConnPoolConfig) WithOptions ¶
func (c *ConnPoolConfig) WithOptions(opts ...ConnPoolConfigOption) *ConnPoolConfig
WithOptions configures the receiver ConnPoolConfig with the passed in options set
type ConnPoolConfigOption ¶
type ConnPoolConfigOption func(c *ConnPoolConfig)
func WithHealthCheckInterval ¶
func WithHealthCheckInterval(healthCheckInterval time.Duration) ConnPoolConfigOption
WithHealthCheckInterval returns an option that can set HealthCheckInterval on a ConnPoolConfig
func WithMaxIdleTime ¶
func WithMaxIdleTime(maxIdleTime time.Duration) ConnPoolConfigOption
WithMaxIdleTime returns an option that can set MaxIdleTime on a ConnPoolConfig
func WithMaxLifetime ¶
func WithMaxLifetime(maxLifetime time.Duration) ConnPoolConfigOption
WithMaxLifetime returns an option that can set MaxLifetime on a ConnPoolConfig
func WithMaxLifetimeJitter ¶
func WithMaxLifetimeJitter(maxLifetimeJitter time.Duration) ConnPoolConfigOption
WithMaxLifetimeJitter returns an option that can set MaxLifetimeJitter on a ConnPoolConfig
func WithMaxOpenConns ¶
func WithMaxOpenConns(maxOpenConns int) ConnPoolConfigOption
WithMaxOpenConns returns an option that can set MaxOpenConns on a ConnPoolConfig
func WithMinOpenConns ¶
func WithMinOpenConns(minOpenConns int) ConnPoolConfigOption
WithMinOpenConns returns an option that can set MinOpenConns on a ConnPoolConfig
func WithPingTimeout ¶
func WithPingTimeout(pingTimeout time.Duration) ConnPoolConfigOption
WithPingTimeout returns an option that can set PingTimeout on a ConnPoolConfig
type EngineBuilderFunc ¶
EngineBuilderFunc builds a datastore of a specific engine from the given config.
type RelIntegrityKey ¶
type RelIntegrityKey struct {
KeyID string `debugmap:"visible"`
KeyFilename string `debugmap:"visible"`
}
func NewRelIntegrityKeyWithOptions ¶
func NewRelIntegrityKeyWithOptions(opts ...RelIntegrityKeyOption) *RelIntegrityKey
NewRelIntegrityKeyWithOptions creates a new RelIntegrityKey with the passed in options set
func NewRelIntegrityKeyWithOptionsAndDefaults ¶
func NewRelIntegrityKeyWithOptionsAndDefaults(opts ...RelIntegrityKeyOption) *RelIntegrityKey
NewRelIntegrityKeyWithOptionsAndDefaults creates a new RelIntegrityKey with the passed in options set starting from the defaults
func RelIntegrityKeyWithOptions ¶
func RelIntegrityKeyWithOptions(r *RelIntegrityKey, opts ...RelIntegrityKeyOption) *RelIntegrityKey
RelIntegrityKeyWithOptions configures an existing RelIntegrityKey with the passed in options set
func (*RelIntegrityKey) DebugMap ¶
func (r *RelIntegrityKey) DebugMap() map[string]any
DebugMap returns a map form of RelIntegrityKey for debugging
func (*RelIntegrityKey) FlatDebugMap ¶
func (r *RelIntegrityKey) FlatDebugMap() map[string]any
FlatDebugMap returns a flattened map form of RelIntegrityKey for debugging Nested maps are flattened using dot notation (e.g., "parent.child.field")
func (*RelIntegrityKey) ToOption ¶
func (r *RelIntegrityKey) ToOption() RelIntegrityKeyOption
ToOption returns a new RelIntegrityKeyOption that sets the values from the passed in RelIntegrityKey
func (*RelIntegrityKey) WithOptions ¶
func (r *RelIntegrityKey) WithOptions(opts ...RelIntegrityKeyOption) *RelIntegrityKey
WithOptions configures the receiver RelIntegrityKey with the passed in options set
type RelIntegrityKeyOption ¶
type RelIntegrityKeyOption func(r *RelIntegrityKey)
func WithKeyFilename ¶
func WithKeyFilename(keyFilename string) RelIntegrityKeyOption
WithKeyFilename returns an option that can set KeyFilename on a RelIntegrityKey
func WithKeyID ¶
func WithKeyID(keyID string) RelIntegrityKeyOption
WithKeyID returns an option that can set KeyID on a RelIntegrityKey