Documentation ¶
Index ¶
- func AddCompressorToURI(uri string) string
- func AddOptionsToURI(uri string, opts ...string) string
- func AddServerlessAuthCredentials(uri string) (string, error)
- func AddTLSConfigToURI(uri string) string
- func AddTestServerAPIVersion(opts *options.ClientOptions)
- func AutoInsertDocs(t *testing.T, writeConcern *writeconcern.WriteConcern, ...)
- func ColName(t *testing.T) string
- func CompareVersions(t *testing.T, v1 string, v2 string) int
- func ConnString(t *testing.T) connstring.ConnString
- func DBName(t *testing.T) string
- func DropCollection(t *testing.T, dbname, colname string)
- func GetConnString() (connstring.ConnString, error)
- func GetDBName(cs connstring.ConnString) string
- func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, ...)
- func MongoDBURI() (string, error)
- func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology
- func RunCommand(s driver.Server, db string, cmd bsoncore.Document) (bsoncore.Document, error)
- func Topology(t *testing.T) *topology.Topology
- func TopologyWithCredential(t *testing.T, credential options.Credential) *topology.Topology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCompressorToURI ¶ added in v1.8.0
AddCompressorToURI checks for the environment variable indicating that the tests are being run with compression enabled. If so, it returns a new URI with the necessary configuration
func AddOptionsToURI ¶
AddOptionsToURI appends connection string options to a URI.
func AddServerlessAuthCredentials ¶ added in v1.11.0
AddServerlessAuthCredentials will attempt to construct the serverless auth credentials for a URI.
func AddTLSConfigToURI ¶
AddTLSConfigToURI checks for the environmental variable indicating that the tests are being run on an SSL-enabled server, and if so, returns a new URI with the necessary configuration.
func AddTestServerAPIVersion ¶ added in v1.6.0
func AddTestServerAPIVersion(opts *options.ClientOptions)
AddTestServerAPIVersion adds the latest server API version in a ServerAPIOptions to passed-in opts.
func AutoInsertDocs ¶
func AutoInsertDocs(t *testing.T, writeConcern *writeconcern.WriteConcern, docs ...bsoncore.Document)
AutoInsertDocs inserts the docs into the test cluster.
func ColName ¶
ColName gets a collection name that should be unique to the currently executing test.
func CompareVersions ¶ added in v1.0.0
CompareVersions compares two version number strings (i.e. positive integers separated by periods). Comparisons are done to the lesser precision of the two versions. For example, 3.2 is considered equal to 3.2.11, whereas 3.2.0 is considered less than 3.2.11.
Returns a positive int if version1 is greater than version2, a negative int if version1 is less than version2, and 0 if version1 is equal to version2.
func ConnString ¶
func ConnString(t *testing.T) connstring.ConnString
ConnString gets the globally configured connection string.
func DropCollection ¶
DropCollection drops the collection in the test cluster.
func GetConnString ¶ added in v0.0.8
func GetConnString() (connstring.ConnString, error)
func GetDBName ¶ added in v0.0.8
func GetDBName(cs connstring.ConnString) string
func InsertDocs ¶
func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, docs ...bsoncore.Document)
InsertDocs inserts the docs into the test cluster.
func MongoDBURI ¶ added in v1.11.0
MongoDBURI will construct the MongoDB URI from the MONGODB_URI environment variable for testing. The default host is "localhost" and the default port is "27017"
func MonitoredTopology ¶ added in v0.0.10
func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology
MonitoredTopology returns a new topology with the command monitor attached
func RunCommand ¶ added in v0.0.12
RunCommand runs an arbitrary command on a given database of target server
func TopologyWithCredential ¶ added in v1.11.0
TopologyWithCredential takes an "options.Credential" object and returns a connected topology.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package israce reports if the Go race detector is enabled.
|
Package israce reports if the Go race detector is enabled. |
Package monitor provides test types that are used to monitor client state and actions via the various monitor types supported by the driver.
|
Package monitor provides test types that are used to monitor client state and actions via the various monitor types supported by the driver. |