Documentation
¶
Index ¶
- func BasicAuth(next http.Handler) http.Handler
- type CustomRouter
- func (r *CustomRouter) DELETE(path string, handle httprouter.Handle)
- func (r *CustomRouter) GET(path string, handle httprouter.Handle)
- func (r *CustomRouter) OPTIONS(path string, handle httprouter.Handle)
- func (r *CustomRouter) PATCH(path string, handle httprouter.Handle)
- func (r *CustomRouter) POST(path string, handle httprouter.Handle)
- func (r *CustomRouter) PUT(path string, handle httprouter.Handle)
- func (r *CustomRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomRouter ¶
type CustomRouter struct {
*httprouter.Router
// contains filtered or unexported fields
}
CustomRouter extends httprouter.Router to handle API routes separately from data routes
func NewCustomRouter ¶
func NewCustomRouter() *CustomRouter
NewCustomRouter creates a new CustomRouter
func (*CustomRouter) DELETE ¶
func (r *CustomRouter) DELETE(path string, handle httprouter.Handle)
DELETE registers a DELETE handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) GET ¶
func (r *CustomRouter) GET(path string, handle httprouter.Handle)
GET registers a GET handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) OPTIONS ¶
func (r *CustomRouter) OPTIONS(path string, handle httprouter.Handle)
OPTIONS registers an OPTIONS handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) PATCH ¶
func (r *CustomRouter) PATCH(path string, handle httprouter.Handle)
PATCH registers a PATCH handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) POST ¶
func (r *CustomRouter) POST(path string, handle httprouter.Handle)
POST registers a POST handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) PUT ¶
func (r *CustomRouter) PUT(path string, handle httprouter.Handle)
PUT registers a PUT handler for the API router if path starts with /__/, otherwise for the data router
func (*CustomRouter) ServeHTTP ¶
func (r *CustomRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements the http.Handler interface