database

package
v0.0.0-...-bea4ea4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: AGPL-3.0-or-later Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Postgres *gorm.DB

Functions

func NewMemcache

func NewMemcache() *memcache.Client

func NewPostgres

func NewPostgres() *gorm.DB

Types

type MongoDB

type MongoDB struct {
	Current *mgo.Database
}

func NewMongoDB

func NewMongoDB(options ...string) MongoDB

func (MongoDB) Count

func (d MongoDB) Count(resource interface{}, query bson.M) (int, error)

func (MongoDB) Create

func (d MongoDB) Create(data interface{}) error

func (MongoDB) Find

func (d MongoDB) Find(query interface{}, limit, page int, sort string, result interface{}) error

func (MongoDB) FindAll

func (d MongoDB) FindAll(results interface{}) error

func (MongoDB) FindAndGroupBy

func (d MongoDB) FindAndGroupBy(by string, query interface{}, result interface{}, collection interface{}) error

func (MongoDB) FindOne

func (d MongoDB) FindOne(query, result interface{}) error

func (MongoDB) Ping

func (m MongoDB) Ping() error

func (MongoDB) Update

func (d MongoDB) Update(query, data interface{}, _type interface{}) error

func (MongoDB) Upsert

func (d MongoDB) Upsert(query, data interface{}, _type interface{}) (*mgo.ChangeInfo, error)

Jump to

Keyboard shortcuts

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