Documentation
¶
Overview ¶
Package cockroachdb contains an implementation of the `gokv.Store` interface for CockroachDB.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ ConnectionURL: "postgres://root@localhost:26257/" + defaultDBname + "?sslmode=disable&application_name=gokv", TableName: "Item", MaxOpenConnections: 100, Codec: encoding.JSON, }
DefaultOptions is an Options object with default values. ConnectionURL: "postgres://root@localhost:26257/gokv?sslmode=disable&application_name=gokv", TableName: "Item", MaxOpenConnections: 100, Codec: encoding.JSON
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Connection URL.
// Format: postgres://username[:password]@address/dbname[?param1=value1&...¶mN=valueN].
// Example: "postgres://roach:secret@localhost:26257/gokv?sslmode=disable".
// The database ("dbname" in the example) must already exist.
// For a full list of available connection parameters, see:
// https://github.com/cockroachdb/docs/blob/560c4227f4d811c5be9dc8e4a5385e508d0c68e5/v2.1/connection-parameters.md#additional-connection-parameters.
// Optional ("postgres://root@localhost:26257/gokv?sslmode=disable&application_name=gokv" by default,
// which will connect to "localhost:26257" as root user and doesn't use TLS,
// which you should NOT do in production).
ConnectionURL string
// Name of the table in which the key-value pairs are stored.
// Optional ("Item" by default).
TableName string
// Limits the number of open connections to the CockroachDB server.
// -1 for no limit. 0 will lead to the default value (100) being set.
// Optional (100 by default).
MaxOpenConnections int
// Encoding format.
// Optional (encoding.JSON by default).
Codec encoding.Codec
}
Options are the options for the CockroachDB client.
Click to show internal directories.
Click to hide internal directories.