mongodb

package
v0.0.0-...-3629385 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_MONGODB_MIN_OPEN       = 3
	DEFAULT_MONGODB_MAX_OPEN       = 10
	DEFAULT_MONGODB_MIN_OPEN_LIMIT = DEFAULT_MONGODB_MIN_OPEN
	DEFAULT_MONGODB_MAX_OPEN_LIMIT = DEFAULT_MONGODB_MAX_OPEN
)

Variables

Functions

func InitMongoDB

func InitMongoDB(c *Config) (func() error, error)

Types

type Config

type Config struct {
	StartupRetryPeriod time.Duration `json:"startup_retry_period" toml:"-" mapstructure:"-"`
	StartupRetryTimes  int           `json:"startup_retry_times" toml:"-" mapstructure:"-"`
	ConnectTimeout     time.Duration `json:"connect_timeout" toml:"-" mapstructure:"-"`

	DSN         string        `json:"dsn" toml:"dsn" mapstructure:"dsn"`
	MinOpen     uint64        `json:"min_open" toml:"min_open" mapstructure:"min_open"`
	MaxOpen     uint64        `json:"max_open" toml:"max_open" mapstructure:"max_open"`
	MaxLifetime time.Duration `json:"max_lifetime" toml:"-" mapstructure:"-"`
}

func (*Config) String

func (m *Config) String() string

func (*Config) VerifyConfig

func (c *Config) VerifyConfig() error

Jump to

Keyboard shortcuts

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