gmongo

package
v0.0.0-...-b6b8bdf Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO_KEY_ID    = "_id"
	MONGO_OPT_SET   = "$set"
	MONGO_OPT_UNSET = "$unset"
)
View Source
const (
	MongoTag    = "mongo.c"
	MongoDomain = "mongo.domain"
)

Variables

View Source
var IMongoDBDriverType = reflect.TypeOf((*IMongoDBDriver)(nil)).Elem()

Functions

func NewMongoDriver

func NewMongoDriver(name string, url string, dbname string) *mongoDBDriver

Types

type AutoConfigMongo

type AutoConfigMongo struct {

	// 启动条件
	gioc.IBeanCondition
	gioc.IConfigBase
	// contains filtered or unexported fields
}

func NewAutoConfigMongo

func NewAutoConfigMongo(cfgBase, domain string) *AutoConfigMongo

func (AutoConfigMongo) GetAttributeGroup

func (this AutoConfigMongo) GetAttributeGroup(group, id string) gdb.IDBAttributeGroup

func (AutoConfigMongo) GetCollection

func (this AutoConfigMongo) GetCollection(name string) *mgo.Collection

func (AutoConfigMongo) GetPriority

func (this AutoConfigMongo) GetPriority() int

func (AutoConfigMongo) MongoDb

func (this AutoConfigMongo) MongoDb()

func (AutoConfigMongo) Name

func (this AutoConfigMongo) Name() string

func (*AutoConfigMongo) PrepareProcess

func (this *AutoConfigMongo) PrepareProcess()

func (*AutoConfigMongo) TagProcess

func (this *AutoConfigMongo) TagProcess(bean interface{}, fType reflect.StructField, fValue reflect.Value, tags map[string]string)

func (*AutoConfigMongo) TagProcessorName

func (this *AutoConfigMongo) TagProcessorName() string

type IMongoDBDriver

type IMongoDBDriver interface {
	Name() string
	MongoDb()
	GetCollection(name string) *mgo.Collection
	GetAttributeGroup(group, id string) gdb.IDBAttributeGroup
}

type MongoAttributeGroup

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

func NewMongoAttributeGroup

func NewMongoAttributeGroup(collection *mgo.Collection, id string) *MongoAttributeGroup

func (*MongoAttributeGroup) CasSetAttribute

func (this *MongoAttributeGroup) CasSetAttribute(key string, oldValue string, newValue string) bool

func (*MongoAttributeGroup) GetAttribute

func (this *MongoAttributeGroup) GetAttribute(key string) (string, error)

func (*MongoAttributeGroup) SetAttribute

func (this *MongoAttributeGroup) SetAttribute(key string, value string) error

func (*MongoAttributeGroup) SetAttributes

func (this *MongoAttributeGroup) SetAttributes(values map[string]interface{}) error

type MongoMessageQueue

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

func NewMongoMessageQueue

func NewMongoMessageQueue(queue string, session *mgo.Session) *MongoMessageQueue

func (*MongoMessageQueue) Name

func (this *MongoMessageQueue) Name() string

func (*MongoMessageQueue) Pop

func (this *MongoMessageQueue) Pop(num int) []string

func (*MongoMessageQueue) Push

func (this *MongoMessageQueue) Push(msg string) bool

type MongoTagProcessor

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

func NewMongoTagProcessor

func NewMongoTagProcessor(driver *mongoDBDriver) *MongoTagProcessor

func (*MongoTagProcessor) PrepareProcess

func (this *MongoTagProcessor) PrepareProcess()

func (*MongoTagProcessor) TagProcess

func (this *MongoTagProcessor) TagProcess(bean interface{}, fType reflect.StructField, fValue reflect.Value, tags map[string]string)

func (*MongoTagProcessor) TagProcessorName

func (this *MongoTagProcessor) TagProcessorName() string

Jump to

Keyboard shortcuts

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