package
0.2.1
Repository: https://github.com/codepope/transporter.git
Documentation: pkg.go.dev

# README

MongoDB adaptor

The MongoDB adaptor is capable of reading/tailing collections and receiving data for inserts.

Configuration:

- mongodb:
    type: mongo
    uri: mongodb://127.0.0.1:27017/test
    # timeout: 30s
    # tail: false
    # ssl: false
    # cacerts: ["/path/to/cert.pem"]
    # wc: 1
    # fsync: false
    # bulk: false

# Functions

NewClient creates a new client to work with MongoDB.
WithCACerts configures the RootCAs for the underlying TLS connection.
WithFsync configures whether the server will wait for Fsync to complete before returning a response (Default: false).
WithSSL configures the database connection to connect via TLS.
WithTail set the flag to tell the Client whether or not access to the oplog will be needed (Default: false).
WithTimeout overrides the DefaultSessionTimeout and should be parseable by time.ParseDuration.
WithURI defines the full connection string of the MongoDB database.
WithWriteConcern configures the write concern option for the session (Default: 0).

# Constants

DefaultSessionTimeout is the default timeout after which the session times out when unable to connect to the provided URI.
DefaultURI is the default endpoint of MongoDB on the local machine.

# Variables

DefaultSafety is the default saftey mode used for the underlying session.

# Structs

Bulk implements client.Writer for use with MongoDB and takes advantage of the Bulk API for performance improvements.
Client represents a client to the underlying MongoDB source.
Config provides configuration options for a mongodb adaptor the notable difference between this and dbConfig is the presence of the Tail option.
MongoDB is an adaptor to read / write to mongodb.
OplogAccessError wraps the underlying error when access to the oplog fails.
Reader implements the behavior defined by client.Reader for interfacing with MongoDB.
Session serves as a wrapper for the underlying mgo.Session.
Tailer implements the behavior defined by client.Reader for interfacing with the MongoDB oplog.
Writer implements client.Writer for use with MongoDB.

# Type aliases

ClientOptionFunc is a function that configures a Client.