mongo

package
v0.0.0-...-480e040 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectTimeOut = 60
	StatusSuccess  = "Success"
)

Variables

This section is empty.

Functions

func Debug

func Debug(debug bool)

Types

type MgoCmd

type MgoCmd interface {
	Insert(args interface{}) error
	Update(condition interface{}, args interface{}) error
	UpdateByID(id string, args interface{}) error
	UpdateAll(condition interface{}, args interface{}) (*mgo.ChangeInfo, error)
	Upsert(condition interface{}, args interface{}) (*mgo.ChangeInfo, error)
	FindByID(id string) Query
	Find(interface{}) Query
	Delete(condition interface{}) error
	DeleteAll(condition interface{}) (*mgo.ChangeInfo, error)
	DeleteByID(id string) error
}

type MgoSession

type MgoSession interface {
	New() *mgo.Session
	DB(dbname, collection string) MgoCmd
	Status() string
	Close()
}

func Dial

func Dial(c config.Config) (MgoSession, errors.Error)

mongoDial - Mongo Driver Connect

type Query

type Query interface {
	All(interface{}) error
	One(interface{}) error
	Sort(...string) Query
	Select(interface{}) Query
	Limit(int) Query
	Skip(int) Query
	Count() (int, error)
}

Jump to

Keyboard shortcuts

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