Documentation ¶
Index ¶
- func NewCRDBDatastore(url string, options ...Option) (datastore.Datastore, error)
- type Option
- func ConnMaxIdleTime(idle time.Duration) Option
- func ConnMaxLifetime(lifetime time.Duration) Option
- func GCWindow(window time.Duration) Option
- func MaxOpenConns(conns int) Option
- func MaxRetries(maxRetries int) Option
- func MaxRevisionStalenessPercent(stalenessPercent float64) Option
- func MinOpenConns(conns int) Option
- func OverlapKey(key string) Option
- func OverlapStrategy(strategy string) Option
- func RevisionQuantization(bucketSize time.Duration) Option
- func SplitAtEstimatedQuerySize(splitAtEstimatedQuerySize units.Base2Bytes) Option
- func WatchBufferLength(watchBufferLength uint16) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v1.0.0
type Option func(*crdbOptions)
Option provides the facility to configure how clients within the CRDB datastore interact with the running CockroachDB database.
func ConnMaxIdleTime ¶
ConnMaxIdleTime is the duration after which an idle connection will be automatically closed by the health check.
This value defaults to having no maximum.
func ConnMaxLifetime ¶
ConnMaxLifetime is the duration since creation after which a connection will be automatically closed.
This value defaults to having no maximum.
func GCWindow ¶
GCWindow is the maximum age of a passed revision that will be considered valid.
This value defaults to 24 hours.
func MaxOpenConns ¶
MaxOpenConns is the maximum size of the connection pool.
This value defaults to having no maximum.
func MaxRetries ¶ added in v1.0.0
MaxRetries is the maximum number of times a retriable transaction will be client-side retried. Default: 50
func MaxRevisionStalenessPercent ¶ added in v1.0.0
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 MinOpenConns ¶
MinOpenConns is the minimum size of the connection pool. The health check will increase the number of connections to this amount if it had dropped below.
This value defaults to zero.
func OverlapKey ¶ added in v1.0.0
OverlapKey is a key touched on every write if OverlapStrategy is "static" Default: 'key'
func OverlapStrategy ¶ added in v1.0.0
OverlapStrategy is the strategy used to generate overlap keys on write. Default: 'static'
func RevisionQuantization ¶
RevisionQuantization is the time bucket size to which advertised revisions will be rounded.
This value defaults to 5 seconds.
func SplitAtEstimatedQuerySize ¶
func SplitAtEstimatedQuerySize(splitAtEstimatedQuerySize units.Base2Bytes) Option
SplitAtEstimatedQuerySize is the query size at which it is split into two (or more) queries.
This value defaults to `common.DefaultSplitAtEstimatedQuerySize`.
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.