shared

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCodeCommentToQuery added in v0.4.0

func AddCodeCommentToQuery(query *mgo.Query) *mgo.Query

AddCodeCommentToQuery adds location of the caller in the source code (e.g. "oplog_status.go:91") to the given query as a comment.

func LoadCaFrom added in v0.2.0

func LoadCaFrom(pemFile string) (*x509.CertPool, error)

func LoadKeyPairFrom added in v0.2.0

func LoadKeyPairFrom(pemFile string, privateKeyPemFile string) (tls.Certificate, error)

func MongoSession

func MongoSession(opts *MongoSessionOpts) *mgo.Session

MongoSession connects to MongoDB and returns ready to use MongoDB session.

func MongoSessionNodeType

func MongoSessionNodeType(session *mgo.Session) (string, error)

func MongoSessionServerVersion

func MongoSessionServerVersion(session *mgo.Session) (string, error)

func RedactMongoUri added in v0.2.0

func RedactMongoUri(uri string) string

func TestConnection added in v0.6.0

func TestConnection(opts MongoSessionOpts) ([]byte, error)

TestConnection connects to MongoDB and returns BuildInfo.

Types

type MongoSessionOpts added in v0.2.0

type MongoSessionOpts struct {
	URI                   string
	TLSConnection         bool
	TLSCertificateFile    string
	TLSPrivateKeyFile     string
	TLSCaFile             string
	TLSHostnameValidation bool
	PoolLimit             int
	SocketTimeout         time.Duration
	SyncTimeout           time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL