middlewares

package
v0.0.0-...-8f17b14 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() gin.HandlerFunc

Auth handles the user authorization in the application.

func NewDatabaseMiddleware

func NewDatabaseMiddleware(host, dbname string) gin.HandlerFunc

func NewGoogleMiddleware

func NewGoogleMiddleware() gin.HandlerFunc

func NewGoogleMiddlewareWithRoundTripper

func NewGoogleMiddlewareWithRoundTripper(roundTripper http.RoundTripper) gin.HandlerFunc

Types

type DB

type DB struct {
	*mgo.Database
}

func (*DB) C

func (db *DB) C(name string) interfaces.DBCollection

type DBCollection

type DBCollection struct {
	*mgo.Collection
}

func (*DBCollection) AggregationIterator

func (dbc *DBCollection) AggregationIterator(query interface{}) interfaces.DBResultIterator

func (*DBCollection) AggregationOne

func (dbc *DBCollection) AggregationOne(query, result interface{}) error

func (*DBCollection) Find

func (dbc *DBCollection) Find(query interface{}) interfaces.DBQuery

func (*DBCollection) FindOne

func (dbc *DBCollection) FindOne(query interface{}, result interface{}) (bool, error)

FindOne finds the first object matched by the query and stores it into result. Returns whether the object has been found or not and an error.

func (*DBCollection) Insert

func (dbc *DBCollection) Insert(object interface{}) error

type DBConnection

type DBConnection struct {
	*mgo.Session
}

func (*DBConnection) Clone

func (dbc *DBConnection) Clone() interfaces.DBConnection

func (*DBConnection) DB

func (dbc *DBConnection) DB(name string) interfaces.Database

type DBQuery

type DBQuery struct {
	*mgo.Query
}

func (*DBQuery) Iterator

func (dbq *DBQuery) Iterator() interfaces.DBResultIterator

type DBResultIterator

type DBResultIterator struct {
	*mgo.Iter
}

type Google

type Google struct {
	*oauth2.Service
}

func (*Google) VerifyToken

func (google *Google) VerifyToken(token string) (*types.User, error)

Jump to

Keyboard shortcuts

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