Documentation ¶
Index ¶
- func SetDefaultAppName(val string)
- func SetDefaultAuthMechanism(val string)
- func SetDefaultAuthMechanismProperties(val map[string]string)
- func SetDefaultAuthPassword(val string)
- func SetDefaultAuthPasswordSet(val bool)
- func SetDefaultAuthSource(val string)
- func SetDefaultAuthUsername(val string)
- func SetDefaultCollection(val string)
- func SetDefaultCompressors(val []string)
- func SetDefaultConnectionTimeout(val time.Duration)
- func SetDefaultCredentialFlagsPrefix(val string)
- func SetDefaultDatabase(val string)
- func SetDefaultDirect(val bool)
- func SetDefaultDisableOCSPEndpointCheck(val bool)
- func SetDefaultHeartbeatInterval(val time.Duration)
- func SetDefaultHosts(val []string)
- func SetDefaultLocalThreshold(val time.Duration)
- func SetDefaultMaxConnIdleTime(val time.Duration)
- func SetDefaultMaxPoolSize(val uint64)
- func SetDefaultMinPoolSize(val uint64)
- func SetDefaultMongoFlagsPrefix(val string)
- func SetDefaultReadConcernFlagsPrefix(val string)
- func SetDefaultReadConcernLevel(val string)
- func SetDefaultReadPrefFlagsPrefix(val string)
- func SetDefaultReadPrefHedgeEnabled(val bool)
- func SetDefaultReadPrefMaxStaleness(val time.Duration)
- func SetDefaultReadPrefMode(val readpref.Mode)
- func SetDefaultReadPrefTagSets(val []tag.Set)
- func SetDefaultReplicaSet(val string)
- func SetDefaultRetryReads(val bool)
- func SetDefaultRetryWrites(val bool)
- func SetDefaultSeverSelectTimeout(val time.Duration)
- func SetDefaultSocketTimeout(val time.Duration)
- func SetDefaultURI(val string)
- func SetDefaultZlibLevel(val int)
- func SetDefaultZstdLevel(val int)
- type ClientOptions
- type Credential
- type ReadConcern
- type ReadPref
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultAppName ¶
func SetDefaultAppName(val string)
func SetDefaultAuthMechanism ¶
func SetDefaultAuthMechanism(val string)
func SetDefaultAuthPassword ¶
func SetDefaultAuthPassword(val string)
func SetDefaultAuthPasswordSet ¶
func SetDefaultAuthPasswordSet(val bool)
func SetDefaultAuthSource ¶
func SetDefaultAuthSource(val string)
func SetDefaultAuthUsername ¶
func SetDefaultAuthUsername(val string)
func SetDefaultCollection ¶
func SetDefaultCollection(val string)
func SetDefaultCompressors ¶
func SetDefaultCompressors(val []string)
func SetDefaultCredentialFlagsPrefix ¶
func SetDefaultCredentialFlagsPrefix(val string)
func SetDefaultDatabase ¶
func SetDefaultDatabase(val string)
func SetDefaultDirect ¶
func SetDefaultDirect(val bool)
func SetDefaultDisableOCSPEndpointCheck ¶
func SetDefaultDisableOCSPEndpointCheck(val bool)
func SetDefaultHosts ¶
func SetDefaultHosts(val []string)
func SetDefaultMaxPoolSize ¶
func SetDefaultMaxPoolSize(val uint64)
func SetDefaultMinPoolSize ¶
func SetDefaultMinPoolSize(val uint64)
func SetDefaultMongoFlagsPrefix ¶
func SetDefaultMongoFlagsPrefix(val string)
func SetDefaultReadConcernFlagsPrefix ¶
func SetDefaultReadConcernFlagsPrefix(val string)
func SetDefaultReadConcernLevel ¶
func SetDefaultReadConcernLevel(val string)
func SetDefaultReadPrefFlagsPrefix ¶
func SetDefaultReadPrefFlagsPrefix(val string)
func SetDefaultReadPrefHedgeEnabled ¶
func SetDefaultReadPrefHedgeEnabled(val bool)
func SetDefaultReadPrefMode ¶
func SetDefaultReplicaSet ¶
func SetDefaultReplicaSet(val string)
func SetDefaultRetryReads ¶
func SetDefaultRetryReads(val bool)
func SetDefaultRetryWrites ¶
func SetDefaultRetryWrites(val bool)
func SetDefaultSocketTimeout ¶
func SetDefaultURI ¶
func SetDefaultURI(val string)
func SetDefaultZlibLevel ¶
func SetDefaultZlibLevel(val int)
func SetDefaultZstdLevel ¶
func SetDefaultZstdLevel(val int)
Types ¶
type ClientOptions ¶
type ClientOptions struct { AppName string `json:"app-name" yaml:"app-name"` Auth Credential `json:"auth" yaml:"auth"` ConnectTimeout time.Duration `json:"connect-timeout" yaml:"connect-timeout"` Compressors []string `json:"compressors" yaml:"compressors"` Collection string `json:"collection" yaml:"collection"` DB string `json:"database" yaml:"database"` Direct bool `json:"direct" yaml:"direct"` DisableOCSPEndpointCheck bool `json:"disable-ocsp-endpoint-check" yaml:"disable-ocsp-endpoint-check"` HeartbeatInterval time.Duration `json:"heartbeat-interval" yaml:"heartbeat-interval"` Hosts []string `json:"hosts" yaml:"hosts"` LocalThreshold time.Duration `json:"local-threshold" yaml:"local-threshold"` MaxConnIdleTime time.Duration `json:"max-conn-idle-time" yaml:"max-conn-idle-time"` MaxPoolSize uint64 `json:"max-pool-size" yaml:"max-pool-size"` MinPoolSize uint64 `json:"min-pool-size" yaml:"min-pool-size"` // ReadConcern for replica sets and replica set shards determines which data to return from a query. ReadConcern ReadConcern `json:"read-concern" yaml:"read-concern"` // ReadPreference determines which servers are considered suitable for read operations. ReadPreference ReadPref `json:"read-preference" yaml:"read-preference"` ReplicaSet string `json:"replica-set" yaml:"replica-set"` RetryReads bool `json:"retry-reads" yaml:"retry-reads"` RetryWrites bool `json:"retry-writes" yaml:"retry-writes"` ServerSelectionTimeout time.Duration `json:"server-selection-timeout" yaml:"server-selection-timeout"` SocketTimeout time.Duration `json:"socket-timeout" yaml:"socket-timeout"` URI string `json:"uri" yaml:"uri"` ZlibLevel int `json:"zlib-level" yaml:"zlib-yaml"` ZstdLevel int `json:"zstd-level" yaml:"zstd-yaml"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
func (*ClientOptions) BindFlags ¶
func (m *ClientOptions) BindFlags(fs *bootflag.FlagSet)
func (*ClientOptions) Parse ¶
func (m *ClientOptions) Parse() (err error)
func (*ClientOptions) Standardize ¶
func (m *ClientOptions) Standardize() (opts *options.ClientOptions, err error)
type Credential ¶
type Credential struct { AuthMechanism string `json:"mechanism" yaml:"mechanism"` AuthMechanismProperties map[string]string `json:"mechanism-properties" yaml:"mechanism-properties"` AuthSource string `json:"source" yaml:"source"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` PasswordSet bool `json:"password-set" yaml:"password-set"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
Credential can be used to provide authentication options when configuring a Client.
See official go-mongo-driver doc https://godoc.org/go.mongodb.org/mongo-driver/mongo/options#Credential for details.
func (*Credential) BindFlags ¶
func (c *Credential) BindFlags(fs *bootflag.FlagSet)
func (*Credential) Parse ¶
func (c *Credential) Parse() (err error)
type ReadConcern ¶
type ReadConcern struct { Level string `json:"level" yaml:"level"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
ReadConcern for replica sets and replica set shards determines which data to return from a query.
func (*ReadConcern) BindFlags ¶
func (rc *ReadConcern) BindFlags(fs *bootflag.FlagSet)
func (*ReadConcern) Parse ¶
func (rc *ReadConcern) Parse() (err error)
type ReadPref ¶
type ReadPref struct { MaxStaleness time.Duration `json:"max-staleness" yaml:"max-staleness"` Mode readpref.Mode `json:"mode" yaml:"mode"` TagSets []tag.Set `json:"tag-sets" yaml:"tag-sets"` HedgeEnabled bool `json:"hedge-enabled" yaml:"hedge-enabled"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` // contains filtered or unexported fields }
ReadPref determines which servers are considered suitable for read operations.
Click to show internal directories.
Click to hide internal directories.