DBAction

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDocument

type ConfigDocument struct {
	Id       uint64 "_id"
	ServerId uint32 "server_id"
}

type DBObject

type DBObject struct {
	DBname string
	Config ConfigDocument
}

func (*DBObject) Count

func (o *DBObject) Count(s *mgo.Session, tabName string, query interface{}) (ret error, count int)

func (*DBObject) EnsureIndex

func (o *DBObject) EnsureIndex(s *mgo.Session, tabName string, indexs []mgo.Index) error

func (*DBObject) ForEach

func (o *DBObject) ForEach(s *mgo.Session, tabName string, query interface{}, sort string, doc interface{}, callback func(error, bool, interface{}))

func (*DBObject) Get

func (o *DBObject) Get(s *mgo.Session, tabName string, query, res interface{}) error

func (*DBObject) GetAll

func (o *DBObject) GetAll(s *mgo.Session, tabName, sort string, skip, limit int, query, selector, res interface{}) error

func (*DBObject) GetById

func (o *DBObject) GetById(s *mgo.Session, tabName string, id, res interface{}) error

func (*DBObject) Insert

func (o *DBObject) Insert(s *mgo.Session, tabName string, doc interface{}) error

func (*DBObject) InsertArray

func (o *DBObject) InsertArray(s *mgo.Session, tabName string, docs []interface{}) error

func (*DBObject) RemoveAll

func (o *DBObject) RemoveAll(s *mgo.Session, tabName string, query interface{}) error

func (*DBObject) RemoveById

func (o *DBObject) RemoveById(s *mgo.Session, tabName string, id interface{}) error

func (*DBObject) UpdateById

func (o *DBObject) UpdateById(s *mgo.Session, tabName string, id, update interface{}) error

func (*DBObject) UpsertById

func (o *DBObject) UpsertById(s *mgo.Session, tabName string, id, update interface{}) error

func (*DBObject) UpsertData

func (o *DBObject) UpsertData(s *mgo.Session, tableName string, doc interface{}, keys []KeyPairs) error

type KeyPairs

type KeyPairs struct {
	Key string
	Val interface{}
}

type QueryType

type QueryType uint32
const (
	QueryTypeInsert QueryType = 1
	QueryTypeDelete QueryType = 2
	QueryTypeUpdate QueryType = 3
)

Jump to

Keyboard shortcuts

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