mongo

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMonClient

func InitMonClient(ctx context.Context, mongoName, strCon string) error

func InitMongoConn

func InitMongoConn(ctx context.Context, cfg *MongoConfig) *mongo.Client

Types

type BaseMongo

type BaseMongo struct {
	*mongo.Client
	DataBase string
}

func (*BaseMongo) SetClient

func (b *BaseMongo) SetClient(engine string) bool

type MongoConfig

type MongoConfig struct {
	ReplicaSetName string `json:"replica_set_name" yaml:"replica_set_name"`
	AppUrl         string `json:"app_url" yaml:"app_url"  validate:"required"`
	Database       string `json:"database" yaml:"database"  validate:"required"`
	Username       string `json:"username" yaml:"username"  validate:"required"`
	Password       string `json:"password" yaml:"password"  validate:"required"`
	MaxPoolSize    int64  `json:"max_pool_size" yaml:"max_pool_size"  validate:"required"`
	MaxIdleTimeMS  int64  `json:"max_idle_time_ms" yaml:"max_idle_time_ms"  validate:"required"`
}

Jump to

Keyboard shortcuts

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