Documentation ¶
Index ¶
- type ACLHandlerFunc
- type ACLMap
- type AcceptHeader
- type AcceptHeaders
- type Change
- type ContextHandlerFunc
- type ContextKey
- type ContextMiddlewareFunc
- type ControllerHook
- type IAccessController
- type IContext
- type IContextMiddleware
- type IDatabase
- type IMiddleware
- type IRenderer
- type IResource
- type IRole
- type IRoles
- type IUser
- type IUsers
- type Index
- type MediaType
- type MediaTypeParams
- type MiddlewareFunc
- type Query
- type Route
- type RouteHandlerVersion
- type RouteHandlers
- type Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLMap ¶
type ACLMap map[string]ACLHandlerFunc
type AcceptHeader ¶
type AcceptHeaders ¶
type AcceptHeaders []AcceptHeader
func NewAcceptHeadersFromString ¶
func NewAcceptHeadersFromString(str string) AcceptHeaders
type ContextHandlerFunc ¶
type ContextHandlerFunc func(http.ResponseWriter, *http.Request, IContext)
func (ContextHandlerFunc) ServeHTTP ¶
func (h ContextHandlerFunc) ServeHTTP(rw http.ResponseWriter, r *http.Request, ctx IContext)
type ContextKey ¶
type ContextKey string
type ContextMiddlewareFunc ¶
type ContextMiddlewareFunc func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc, ctx IContext)
func (ContextMiddlewareFunc) ServeHTTP ¶
func (m ContextMiddlewareFunc) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc, ctx IContext)
type ControllerHook ¶
type IAccessController ¶
type IContext ¶
type IContext interface { Set(r *http.Request, key interface{}, val interface{}) Get(r *http.Request, key interface{}) interface{} SetCurrentUserCtx(r *http.Request, user IUser) GetCurrentUserCtx(r *http.Request) IUser InjectMiddleware(ContextMiddlewareFunc) MiddlewareFunc Inject(handler ContextHandlerFunc) http.HandlerFunc }
type IContextMiddleware ¶
type IContextMiddleware interface {
Handler(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc, ctx IContext)
}
type IDatabase ¶
type IDatabase interface { Insert(name string, obj interface{}) error Update(name string, query Query, change Change, result interface{}) error UpdateAll(name string, query Query, change Query) (int, error) FindOne(name string, query Query, result interface{}) error FindAll(name string, query Query, result interface{}, limit int, sort string) error Count(name string, query Query) (int, error) RemoveOne(name string, query Query) error RemoveAll(name string, query Query) error Exists(name string, query Query) bool DropCollection(name string) error DropDatabase() error EnsureIndex(name string, index mgo.Index) error }
Database interface
type IMiddleware ¶
type IMiddleware interface {
Handler(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
}
type IRenderer ¶
type IRenderer interface { Render(w http.ResponseWriter, req *http.Request, status int, v interface{}) JSON(w http.ResponseWriter, status int, v interface{}) XML(w http.ResponseWriter, status int, v interface{}) Data(w http.ResponseWriter, status int, v []byte) Text(w http.ResponseWriter, status int, v []byte) }
Renderer interface
type MediaTypeParams ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (MiddlewareFunc) ServeHTTP ¶
func (m MiddlewareFunc) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type Route ¶
type Route struct { Name string Method string Pattern string DefaultVersion RouteHandlerVersion RouteHandlers RouteHandlers ACLHandler ACLHandlerFunc }
Route type Note that DefaultVersion must exists in RouteHandlers map See routes.go for examples
type RouteHandlers ¶
type RouteHandlers map[RouteHandlerVersion]http.HandlerFunc
RouteHandlers is a map of route version to its handler
Click to show internal directories.
Click to hide internal directories.