Documentation ¶
Overview ¶
Code generated by github.com/ecordell/optgen. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func NewDatastore(ctx context.Context, options ...ConfigOption) (datastore.Datastore, error)
- func RegisterConnPoolFlagsWithPrefix(flagSet *pflag.FlagSet, prefix string, defaults, opts *ConnPoolConfig)
- func RegisterDatastoreFlags(cmd *cobra.Command, opts *Config) error
- func RegisterDatastoreFlagsWithPrefix(flagSet *pflag.FlagSet, prefix string, opts *Config) error
- type Config
- type ConfigOption
- func SetBootstrapFileContents(bootstrapFileContents map[string][]byte) ConfigOption
- func SetBootstrapFiles(bootstrapFiles []string) ConfigOption
- func WithBootstrapFileContents(key string, value []byte) ConfigOption
- func WithBootstrapFiles(bootstrapFiles string) ConfigOption
- func WithBootstrapOverwrite(bootstrapOverwrite bool) ConfigOption
- func WithBootstrapTimeout(bootstrapTimeout time.Duration) ConfigOption
- func WithDisableStats(disableStats bool) ConfigOption
- func WithEnableDatastoreMetrics(enableDatastoreMetrics bool) ConfigOption
- func WithEngine(engine string) 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 WithLegacyFuzzing(legacyFuzzing time.Duration) ConfigOption
- func WithMaxRetries(maxRetries int) ConfigOption
- func WithMigrationPhase(migrationPhase string) ConfigOption
- func WithOverlapKey(overlapKey string) ConfigOption
- func WithOverlapStrategy(overlapStrategy string) ConfigOption
- func WithReadConnPool(readConnPool ConnPoolConfig) ConfigOption
- func WithReadOnly(readOnly 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 WithSpannerEmulatorHost(spannerEmulatorHost string) ConfigOption
- func WithSplitQueryCount(splitQueryCount uint16) ConfigOption
- func WithTablePrefix(tablePrefix string) ConfigOption
- func WithURI(uRI string) ConfigOption
- func WithWatchBufferLength(watchBufferLength uint16) ConfigOption
- func WithWriteConnPool(writeConnPool ConnPoolConfig) ConfigOption
- type ConnPoolConfig
Constants ¶
const ( MemoryEngine = "memory" PostgresEngine = "postgres" CockroachEngine = "cockroachdb" SpannerEngine = "spanner" MySQLEngine = "mysql" )
Variables ¶
var BuilderForEngine = map[string]engineBuilderFunc{ CockroachEngine: newCRDBDatastore, PostgresEngine: newPostgresDatastore, MemoryEngine: newMemoryDatstore, SpannerEngine: newSpannerDatastore, MySQLEngine: newMySQLDatastore, }
Functions ¶
func NewDatastore ¶
NewDatastore initializes a datastore given the options
func RegisterConnPoolFlagsWithPrefix ¶ added in v1.18.0
func RegisterConnPoolFlagsWithPrefix(flagSet *pflag.FlagSet, prefix string, defaults, opts *ConnPoolConfig)
func RegisterDatastoreFlags ¶
RegisterDatastoreFlags adds datastore flags to a cobra command.
func RegisterDatastoreFlagsWithPrefix ¶ added in v1.16.1
RegisterDatastoreFlagsWithPrefix adds datastore flags to a cobra command, with each flag prefixed with the provided prefix argument. If left empty, the datastore flags are not prefixed.
Types ¶
type Config ¶
type Config struct { Engine string URI string GCWindow time.Duration LegacyFuzzing time.Duration RevisionQuantization time.Duration // Options ReadConnPool ConnPoolConfig WriteConnPool ConnPoolConfig SplitQueryCount uint16 ReadOnly bool EnableDatastoreMetrics bool DisableStats bool // Bootstrap BootstrapFiles []string BootstrapFileContents map[string][]byte BootstrapOverwrite bool BootstrapTimeout time.Duration // Hedging RequestHedgingEnabled bool RequestHedgingInitialSlowValue time.Duration RequestHedgingMaxRequests uint64 RequestHedgingQuantile float64 // CRDB FollowerReadDelay time.Duration MaxRetries int OverlapKey string OverlapStrategy string // Postgres GCInterval time.Duration GCMaxOperationTime time.Duration // Spanner SpannerCredentialsFile string SpannerEmulatorHost string // MySQL TablePrefix string // Internal WatchBufferLength uint16 // Migrations MigrationPhase string }
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 (*Config) ToOption ¶
func (c *Config) ToOption() ConfigOption
ToOption returns a new ConfigOption that sets the values from the passed in Config
type ConfigOption ¶
type ConfigOption func(c *Config)
func SetBootstrapFileContents ¶ added in v1.16.2
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 WithBootstrapFileContents ¶ added in v1.16.2
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 WithBootstrapTimeout ¶ added in v1.15.0
func WithBootstrapTimeout(bootstrapTimeout time.Duration) ConfigOption
WithBootstrapTimeout returns an option that can set BootstrapTimeout on a Config
func WithDisableStats ¶ added in v1.11.0
func WithDisableStats(disableStats bool) ConfigOption
WithDisableStats returns an option that can set DisableStats on a Config
func WithEnableDatastoreMetrics ¶ added in v1.6.0
func WithEnableDatastoreMetrics(enableDatastoreMetrics bool) ConfigOption
WithEnableDatastoreMetrics returns an option that can set EnableDatastoreMetrics on a Config
func WithEngine ¶
func WithEngine(engine string) ConfigOption
WithEngine returns an option that can set Engine 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 WithLegacyFuzzing ¶ added in v1.7.0
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 WithMigrationPhase ¶ added in v1.14.0
func WithMigrationPhase(migrationPhase string) ConfigOption
WithMigrationPhase returns an option that can set MigrationPhase 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 ¶ added in v1.18.0
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 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 WithSpannerEmulatorHost ¶ added in v1.8.0
func WithSpannerEmulatorHost(spannerEmulatorHost string) ConfigOption
WithSpannerEmulatorHost returns an option that can set SpannerEmulatorHost on a Config
func WithSplitQueryCount ¶
func WithSplitQueryCount(splitQueryCount uint16) ConfigOption
WithSplitQueryCount returns an option that can set SplitQueryCount on a Config
func WithTablePrefix ¶ added in v1.7.0
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 ¶ added in v1.6.0
func WithWatchBufferLength(watchBufferLength uint16) ConfigOption
WithWatchBufferLength returns an option that can set WatchBufferLength on a Config
func WithWriteConnPool ¶ added in v1.18.0
func WithWriteConnPool(writeConnPool ConnPoolConfig) ConfigOption
WithWriteConnPool returns an option that can set WriteConnPool on a Config
type ConnPoolConfig ¶ added in v1.18.0
type ConnPoolConfig struct { MaxIdleTime time.Duration MaxLifetime time.Duration MaxOpenConns int MinOpenConns int HealthCheckInterval time.Duration }
func DefaultReadConnPool ¶ added in v1.18.0
func DefaultReadConnPool() *ConnPoolConfig
func DefaultWriteConnPool ¶ added in v1.18.0
func DefaultWriteConnPool() *ConnPoolConfig