db

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMongoDBHost            = "localhost"
	DefaultMongoDBPort            = "27017"
	DefaultMongoDBAuthDB          = "admin"
	DefaultMongoDBTimeout         = "5s"
	DefaultMongoDBTimeoutDuration = time.Duration(5) * time.Second
)
View Source
var (
	ErrMsgAuthFailedStr      = "server returned error on SASL authentication step: Authentication failed."
	ErrNoReachableServersStr = "no reachable servers"
)

Functions

func Dial added in v1.10.0

func Dial(ctx context.Context, conf *Config) (mongo.Client, error)

func LastSSLError

func LastSSLError() error

LastSSLError returns the last error related to the DB connection SSL handshake

Types

type Config

type Config struct {
	mongo.Config
	SSL *SSLConfig
}

func NewConfig

func NewConfig(app *kingpin.Application, envUser string, envPassword string) (*Config, error)

type SSLConfig

type SSLConfig struct {
	Enabled    bool
	PEMKeyFile string
	CAFile     string
	Insecure   bool
}

Jump to

Keyboard shortcuts

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