Documentation
¶
Index ¶
- func GetCallerLocation() string
- func LoadCaFrom(pemFile string) (*x509.CertPool, error)
- func LoadKeyPairFrom(pemFile string, privateKeyPemFile string) (tls.Certificate, error)
- func MongoClient(opts *MongoSessionOpts) *mongo.Client
- func MongoServerVersionLessThan(version string, client *mongo.Client) bool
- func MongoSessionNodeType(client *mongo.Client) (string, error)
- func MongoSessionServerVersion(client *mongo.Client) (string, error)
- func RedactMongoUri(uri string) string
- func TestConnection(opts MongoSessionOpts) ([]byte, error)
- type BuildInfo
- type MongoSessionOpts
- type SyncStringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCallerLocation ¶ added in v0.8.0
func GetCallerLocation() string
GetCallerLocation gets location of the caller in the source code (e.g. "oplog_status.go:91").
func LoadKeyPairFrom ¶ added in v0.2.0
func LoadKeyPairFrom(pemFile string, privateKeyPemFile string) (tls.Certificate, error)
func MongoClient ¶ added in v0.8.0
func MongoClient(opts *MongoSessionOpts) *mongo.Client
MongoClient connects to MongoDB and returns ready to use MongoDB client.
func MongoServerVersionLessThan ¶ added in v0.11.0
func MongoSessionNodeType ¶
MongoSessionNodeType returns mongo node type.
func MongoSessionServerVersion ¶
MongoSessionServerVersion returns mongo server version.
func RedactMongoUri ¶ added in v0.2.0
RedactMongoUri removes login and password from mongoUri.
func TestConnection ¶ added in v0.6.0
func TestConnection(opts MongoSessionOpts) ([]byte, error)
TestConnection connects to MongoDB and returns BuildInfo.
Types ¶
type BuildInfo ¶ added in v0.8.0
type BuildInfo struct { Version string VersionArray []int `bson:"versionArray"` // On MongoDB 2.0+; assembled from Version otherwise GitVersion string `bson:"gitVersion"` OpenSSLVersion string `bson:"OpenSSLVersion"` SysInfo string `bson:"sysInfo"` // Deprecated and empty on MongoDB 3.2+. Bits int Debug bool MaxObjectSize int `bson:"maxBsonObjectSize"` }
BuildInfo represents mongodb build info.
type MongoSessionOpts ¶ added in v0.2.0
type MongoSessionOpts struct {
URI string
}
type SyncStringSet ¶ added in v0.11.0
type SyncStringSet struct {
// contains filtered or unexported fields
}
String set synchronized with sync.RWMutex
func NewSyncStringSet ¶ added in v0.11.0
func NewSyncStringSet() *SyncStringSet
NewSyncStringSet returns new SyncStringSet
func (*SyncStringSet) Add ¶ added in v0.11.0
func (l *SyncStringSet) Add(s string)
Add the value to the set.
func (*SyncStringSet) Contains ¶ added in v0.11.0
func (l *SyncStringSet) Contains(s string) bool
Contains check whether set contains the value
func (*SyncStringSet) Delete ¶ added in v0.11.0
func (l *SyncStringSet) Delete(s string)
Delete value from the set
func (*SyncStringSet) GetAll ¶ added in v0.11.0
func (l *SyncStringSet) GetAll() []string
GetAll returns slice of all values stored in the set