gconf_mongo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient

type MongoClient struct {
	Context context.Context
	Client  *mongo.Client
	DBCon   *mongo.Database
	Session mongo.Session
}

type MongoConfig

type MongoConfig struct {
	Type       MongoType `json:"type"`
	URI        string    `json:"uri"`
	DBName     string    `json:"dbName"`
	Standalone struct{}  `json:"standalone"`
	ReplicaSet struct {
		ReplicaName string `json:"replicaName"`
	} `json:"replicaSet"`
	ShardCluster    struct{}      `json:"shardCluster"`
	MaxPoolSize     uint64        `json:"maxPoolSize"`
	MinPoolSize     uint64        `json:"minPoolSize"`
	MaxConnIdleTime time.Duration `json:"maxConnIdleTime"`
	SocketTimeout   time.Duration `json:"socketTimeout"`
}

func GetDefaultMongoConfig

func GetDefaultMongoConfig() *MongoConfig

func GetMongoConfig

func GetMongoConfig(key string) *MongoConfig

func (*MongoConfig) NewClient

func (mongoConfig *MongoConfig) NewClient() *MongoClient

type MongoType

type MongoType int
const (
	MongoStandalone MongoType = iota
	MongoReplicaSet
	MongoShardCluster
)

Jump to

Keyboard shortcuts

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