Documentation
¶
Index ¶
- Variables
- func DecodeForm(r *http.Request, dst interface{}) error
- func DecodeQuery(r *http.Request, dst interface{}) error
- func Dependency(runners ...runnable.Runnable)
- func Dependent(runners ...runnable.Runnable)
- func Handle(pattern string, handler http.Handler)
- func HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func Run(conf interface{})
- func WriteFailure(w http.ResponseWriter, r *http.Request, err error)
- func WriteJSON(w http.ResponseWriter, resp interface{})
- func WriteResult(w http.ResponseWriter, r *http.Request, result *Result)
- type Engine
- func (e *Engine) Dependency(runners ...runnable.Runnable)
- func (e *Engine) Dependent(runners ...runnable.Runnable)
- func (e *Engine) Handle(pattern string, handler http.Handler)
- func (e *Engine) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (e *Engine) Run(conf interface{})
- func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Failure
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerError = &Failure{Code: "server_error", Status: http.StatusInternalServerError} ErrBadRequest = &Failure{Code: "invalid_request", Status: http.StatusBadRequest} ErrNotFound = &Failure{Code: "not_found", Status: http.StatusNotFound} )
View Source
var DefaultEngine = new(Engine)
Functions ¶
func DecodeForm ¶
func DecodeQuery ¶
func Dependency ¶
func HandleFunc ¶
func HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func WriteFailure ¶
func WriteFailure(w http.ResponseWriter, r *http.Request, err error)
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, resp interface{})
func WriteResult ¶
func WriteResult(w http.ResponseWriter, r *http.Request, result *Result)
Types ¶
Click to show internal directories.
Click to hide internal directories.