mongodb

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: LGPL-2.1 Imports: 8 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) CreateSession added in v0.3.0

func (a *MongoDbAdapter) CreateSession() (mongo.Session, 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:"ReplicaSet,omitempty" config:"ReplicaSet"`
	DirectConnection bool     `json:"DirectConnection,omitempty" config:"DirectConnection"`
	RootCA           string   `json:"RootCA,omitempty" config:"RootCA"`
	AuthSource       string   `json:"AuthSource,omitempty" config:"AuthSource"`
}

Jump to

Keyboard shortcuts

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