mongodb

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDbAdapter

type MongoDbAdapter struct {
	*adapter.BaseAdapter
	// contains filtered or unexported fields
}

func NewMongoDbAdapter

func NewMongoDbAdapter(name string, config *MongoDbConfig) *MongoDbAdapter

func (*MongoDbAdapter) Close

func (a *MongoDbAdapter) Close() error

func (*MongoDbAdapter) Get

func (a *MongoDbAdapter) Get() interface{}

func (*MongoDbAdapter) GetCollection

func (a *MongoDbAdapter) GetCollection(dbName string, collName string) *mongo.Collection

func (*MongoDbAdapter) GetDatabase

func (a *MongoDbAdapter) GetDatabase(name string) *mongo.Database

func (*MongoDbAdapter) Setup

func (a *MongoDbAdapter) Setup() (err error)

type MongoDbConfig

type MongoDbConfig struct {
	Hosts            []string `json:"hosts,omitempty" config:"hosts,required"`
	Username         string   `json:"username,omitempty" config:"username"`
	Password         string   `json:"password,omitempty" config:"password"`
	ReplicaSet       string   `json:"replica_set,omitempty" config:"replica_set"`
	DirectConnection bool     `json:"direct_connection,omitempty" config:"direct_connection"`
}

Jump to

Keyboard shortcuts

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