Documentation
¶
Index ¶
- func ErrPrint(err error)
- func IsCosmosDB(connectionString string) bool
- func IsSlice(o interface{}) bool
- func LoadCertificateAndKey(data []byte) (*tls.Certificate, error)
- func LoadCertificateAndKeyFromFile(path string) (*tls.Certificate, error)
- func MongoShouldReconnect(err error) bool
- func NormalizeObjectIDs(result interface{}, normalize func(id interface{}) (interface{}, bool))
- func ProjectionFields(fields []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCosmosDB ¶
func LoadCertificateAndKey ¶
func LoadCertificateAndKey(data []byte) (*tls.Certificate, error)
func LoadCertificateAndKeyFromFile ¶
func LoadCertificateAndKeyFromFile(path string) (*tls.Certificate, error)
func MongoShouldReconnect ¶ added in v1.3.0
MongoShouldReconnect checks if the error is a network error or a server error that requires reconnection
func NormalizeObjectIDs ¶ added in v1.7.0
func NormalizeObjectIDs(result interface{}, normalize func(id interface{}) (interface{}, bool))
NormalizeObjectIDs rewrites the _id of map results through normalize, which returns the replacement and true when the value is the driver's own id type. Any pointer to a map with string keys, or to a slice of such maps or of pointers to them, is handled, so model.DBM, plain maps and bson.M all qualify; typed destinations are left alone.
func ProjectionFields ¶ added in v1.7.0
ProjectionFields trims the names, keeps the first occurrence of each and skips a child path whose parent is also listed, so drivers build their projection from a clean list.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.