Back to godoc.org
github.com/anpez/gogsi / middlewares

Package middlewares

v0.0.0-...-8f17b14
Latest Go to latest

The highest tagged major version is .

Published: Mar 15, 2016 | License: Apache-2.0 | Module: github.com/anpez/gogsi

Index

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

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)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier