# Packages
Package auth is intended for internal use only.
Package connstring is intended for internal use only.
Package dns is intended for internal use only.
Package drivertest is intended for internal use only.
Package integration is intended for internal use only.
Package mongocrypt is intended for internal use only.
Package ocsp is intended for internal use only.
Package operation is intended for internal use only.
Package session is intended for internal use only.
Package topology is intended for internal use only.
Package wiremessage is intended for internal use only.
# Functions
CompressPayload takes a byte slice and compresses it according to the options passed.
DecompressPayload takes a byte slice that has been compressed and undoes it according to the options passed.
ExtractErrorFromServerResponse extracts an error from a server response bsoncore.Document if there is one.
NewBatchCursor creates a new BatchCursor from the provided parameters.
NewBatchCursorFromDocuments returns a batch cursor with current batch set to a sequence-style DocumentSequence containing the provided documents.
NewCommandResponseError creates a CommandResponseError.
NewCrypt creates a new Crypt instance configured with the given AutoEncryptionOptions.
NewCursorResponse constructs a cursor response from the given response and server.
NewEmptyBatchCursor returns a batch cursor that is empty.
NewServerAPIOptions creates a new ServerAPIOptions configured with the provided serverAPIVersion.
# Constants
ConnectionPoolCleared indicates that the error resulted in the server being marked as Unknown and its connection pool being cleared.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
These constants represent the three different kinds of legacy operations.
LegacyNotPrimaryErrMsg is the error message that older MongoDB servers (see SERVER-50412 for versions) return when a write operation is erroneously sent to a non-primary node.
NoChange indicates that the error did not affect the state of the server.
THese are the availables types of Type.
RetryContext will enable retrying until the context.Context's deadline is exceeded or it is cancelled.
RetryNone disables retrying.
RetryOnce will enable retrying the entire operation once if Timeout is not specified.
RetryOncePerCommand will enable retrying each command associated with an operation if Timeout is not specified.
ServerMarkedUnknown indicates that the error only resulted in the server being marked as Unknown.
TestServerAPIVersion is the most recent, stable variant of options.ServerAPIVersion.
THese are the availables types of Type.
# Variables
ErrCursorNotFound is the cursor not found error for legacy find operations.
ErrDeadlineWouldBeExceeded is returned when a Timeout set on an operation would be exceeded if the operation were sent to the server.
ErrDocumentTooLarge occurs when a document that is larger than the maximum size accepted by a server is passed to an insert command.
ErrMultiDocCommandResponse occurs when the server sent multiple documents in response to a command.
ErrNegativeMaxTime is returned when MaxTime on an operation is a negative value.
ErrNoCursor is returned by NewCursorResponse when the database response does not contain a cursor.
ErrNoDocCommandResponse occurs when the server indicated a response existed, but none was found.
ErrNonPrimaryReadPref is returned when a read is attempted in a transaction with a non-primary read preference.
ErrReplyDocumentMismatch occurs when the number of documents returned in an OP_QUERY does not match the numberReturned field.
ErrUnacknowledgedWrite is returned from functions that have an unacknowledged write concern.
ErrUnsupportedStorageEngine is returned when a retryable write is attempted against a server that uses a storage engine that does not support retryable writes.
NetworkError is an error label for network errors.
NoWritesPerformed is an error label indicated that no writes were performed for an operation.
RetryableWriteError is an error label for retryable write errors.
TransientTransactionError is an error label for transient errors with transactions.
UnknownTransactionCommitResult is an error label for unknown transaction commit results.
# Structs
AuthConfig holds the information necessary to perform an authentication attempt.
BatchCursor is a batch implementation of a cursor.
Batches contains the necessary information to batch split an operation.
CompressionOpts holds settings for how to compress a payload.
Cred is a user's credential.
CryptOptions specifies options to configure a Crypt instance.
CursorOptions are extra options that are required to construct a BatchCursor.
CursorResponse represents the response from a command the results in a cursor.
Error is a command execution error from the database.
HandshakeInformation contains information extracted from a MongoDB connection handshake.
IDPInfo contains the information needed to perform OIDC authentication with an Identity Provider.
InvalidOperationError is returned from Validate and indicates that a required field is missing from an instance of Operation.
OIDCArgs contains the arguments for the OIDC callback.
OIDCCredential contains the access token and refresh token.
Operation is used to execute an operation.
QueryFailureError is an error representing a command failure as a document.
ResponseError is an error parsing the response to a command.
ResponseInfo contains the context required to parse a server response.
ServerAPIOptions represents options used to configure the API version sent to the server when running commands.
SingleConnectionDeployment is an implementation of Deployment that always returns the same Connection.
SingleServerDeployment is an implementation of Deployment that always returns a single server.
Subscription represents a subscription to topology updates.
WriteCommandError is an error for a write command.
WriteConcernError is a write concern failure that occurred as a result of a write operation.
WriteError is a non-write concern failure that occurred as a result of a write operation.
# Interfaces
Authenticator handles authenticating a connection.
Compressor is an interface used to compress wire messages.
Connection represents a connection to a MongoDB server.
Connector represents a type that can connect to a server.
Crypt is an interface implemented by types that can encrypt and decrypt instances of bsoncore.Document.
Deployment is implemented by types that can select a server from a deployment.
Disconnector represents a type that can disconnect from a server.
ErrorProcessor implementations can handle processing errors, which may modify their internal state.
Expirable represents an expirable object.
Handshaker is the interface implemented by types that can perform a MongoDB handshake over a provided driver.Connection.
LocalAddresser is a type that is able to supply its local address.
PinnedConnection represents a Connection that can be pinned by one or more cursors or transactions.
RetryablePoolError is a connection pool error that can be retried while executing an operation.
RTTMonitor represents a round-trip-time monitor.
Server represents a MongoDB server.
StreamerConnection represents a Connection that supports streaming wire protocol messages using the moreToCome and exhaustAllowed flags.
Subscriber represents a type to which another type can subscribe.
# Type aliases
CollectionInfoFn is a callback used to retrieve collection information.
KeyRetrieverFn is a callback used to retrieve keys from the key vault.
LegacyOperationKind indicates if an operation is a legacy find, getMore, or killCursors.
MarkCommandFn is a callback used to add encryption markings to a command.
OIDCCallback is the type for both Human and Machine Callback flows.
ProcessErrorResult represents the result of a ErrorProcessor.ProcessError() call.
RetryMode specifies the way that retries are handled for retryable operations.
Type specifies whether an operation is a read, write, or unknown.
WriteErrors is a group of non-write concern failures that occurred as a result of a write operation.