Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
Username string
Password string
Source string
Mechanism string
AWSSessionToken string
}
Auth Struct holding auth-related options
func (*Auth) RequiresExternalDB ¶
func (*Auth) ShouldAskForPassword ¶
ShouldAskForPassword returns true if the user specifies a username flag but no password, and the authentication mechanism requires a password.
type Connection ¶
type Connection struct {
Host string
Port string
Timeout int
SocketTimeout int
TCPKeepAliveSeconds int
ServerSelectionTimeout int
Compressors string
}
Connection Struct holding connection-related options
type Namespace ¶
type Options ¶
type Options struct {
*URI
*General
*Connection
*SSL
*Auth
*Kerberos
*Namespace
// Force direct connection to the server and disable the
// drivers automatic repl set discovery logic.
Direct bool
// ReplicaSetName, if specified, will prevent the obtained session from
// communicating with any server which is not part of a replica set
// with the given name. The default is to communicate with any server
// specified or discovered via the servers contacted.
ReplicaSetName string
// ReadPreference, if specified, sets the client default
ReadPreference *readpref.ReadPref
// WriteConcern, if specified, sets the client default
WriteConcern *writeconcern.WriteConcern
// RetryWrites, if specified, sets the client default.
RetryWrites *bool
// Query options
QueryOptions
CopyIndexes bool
}
func (*Options) GetAuthenticationDatabase ¶
GetAuthenticationDatabase Get the authentication database to use. Should be the value of --authenticationDatabase if it's provided, otherwise, the database that's specified in the tool's --db arg.
func (*Options) NormalizeOptionsAndURI ¶
NormalizeOptionsAndURI syncs the connection string and toolOptions objects. It returns an error if there is any conflict between options and the connection string. If a value is set on the options, but not the connection string, that value is added to the connection string. If a value is set on the connection string, but not the options, that value is added to the options.
type QueryOptions ¶
type QueryOptions struct {
Query string
QueryFile string
SlaveOk bool
ReadPreference string
ForceTableScan bool
Skip int64
Limit int64
Sort string
AssertExists bool
}
QueryOptions defines the set of options to use in retrieving data from the server.
type SSL ¶
type SSL struct {
UseSSL bool
SSLCAFile string
SSLPEMKeyFile string
SSLPEMKeyPassword string
SSLCRLFile string
SSLAllowInvalidCert bool
SSLAllowInvalidHost bool
SSLFipsMode bool
TLSInsecure bool
}
SSL Struct holding ssl-related options
func (*SSL) ShouldAskForPassword ¶
ShouldAskForPassword returns true if the user specifies a ssl pem key file flag but no password for that file, and the key file has any encrypted blocks.
type URI ¶
type URI struct {
ConnectionString string
ConnString connstring.ConnString
}
func (*URI) GetConnectionAddrs ¶
func (*URI) ParsedConnString ¶
func (uri *URI) ParsedConnString() *connstring.ConnString
type WriteConcern ¶
type WriteConcern struct {
// Specifies the write concern for each write operation that mongofiles writes to the target database.
// By default, mongofiles waits for a majority of members from the replica set to respond before returning.
WriteConcern string
// contains filtered or unexported fields
}