mongodb

package
v0.0.0-...-372ebbf Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Strong    = 1
	Monotonic = 2
)

Variables

View Source
var (
	MONGODB_SESSION_NIL_ERR = errors.New("MongoDBMgr session nil.")
	MONGODB_NOTFOUND_ERR    = errors.New("not found!")
	MONGODB_DBFINDALL_ERR   = errors.New("MongoDBMgr found error")
)

Functions

This section is empty.

Types

type EventReceiver

type EventReceiver = event.EventReceiver

type M

type M = bson.M

type MongoDBInfo

type MongoDBInfo struct {
	DbHost string
	DbPort int
	DbName string
	DbUser string
	DbPass string
}

func NewMongoDBInfo

func NewMongoDBInfo(host string, port int, name, user, pass string) *MongoDBInfo

func (*MongoDBInfo) String

func (this *MongoDBInfo) String() string

type MongoDBMgr

type MongoDBMgr struct {
	// contains filtered or unexported fields
}

func NewMongoDBMgr

func NewMongoDBMgr(m module.Module, dbcfg *MongoDBInfo, timeout time.Duration) *MongoDBMgr

func (*MongoDBMgr) Close

func (this *MongoDBMgr) Close()

func (*MongoDBMgr) DBQuery

func (this *MongoDBMgr) DBQuery(collection string, cond interface{}, result *[]map[string]interface{}) error

func (*MongoDBMgr) DBQueryOneResult

func (this *MongoDBMgr) DBQueryOneResult(collection string, cond interface{}, result map[string]interface{}) error

func (*MongoDBMgr) GetDbSession

func (db *MongoDBMgr) GetDbSession() *mgo.Session

func (*MongoDBMgr) GetID

func (this *MongoDBMgr) GetID() component.ComponentID

func (*MongoDBMgr) GetType

func (this *MongoDBMgr) GetType() component.ComponentType

func (*MongoDBMgr) Insert

func (this *MongoDBMgr) Insert(collection string, doc interface{}) error

func (*MongoDBMgr) Ping

func (this *MongoDBMgr) Ping() error

func (*MongoDBMgr) RefreshSession

func (this *MongoDBMgr) RefreshSession()

func (*MongoDBMgr) RemoveAll

func (this *MongoDBMgr) RemoveAll(collection string, cond interface{}) error

func (*MongoDBMgr) RemoveOne

func (this *MongoDBMgr) RemoveOne(collection string, cond_name string, cond_value int64) error

func (*MongoDBMgr) RemoveOneByCond

func (this *MongoDBMgr) RemoveOneByCond(collection string, cond interface{}) error

func (*MongoDBMgr) SetMode

func (this *MongoDBMgr) SetMode(mode int, refresh bool)

func (*MongoDBMgr) Start

func (this *MongoDBMgr) Start() bool

func (*MongoDBMgr) Update

func (this *MongoDBMgr) Update(collection string, cond interface{}, change interface{}) error

func (*MongoDBMgr) UpdateInsert

func (this *MongoDBMgr) UpdateInsert(collection string, cond interface{}, doc interface{}) error

Jump to

Keyboard shortcuts

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