Documentation ¶
Index ¶
- func Endpoint(name string, handler http.HandlerFunc) http.Handler
- func EndpointWithAsyncTask()
- func EndpointWithAuthentication()
- func EndpointWithCustomMiddlewares(name string, handler http.HandlerFunc, pre, post []http.HandlerFunc) http.Handler
- func EndpointWithErrorHandler()
- func EndpointWithProxy()
- func EndpointWithRateLimit()
- func EndpointWithRedirect()
- func JSONEndpoint(name string, handler http.HandlerFunc) http.Handler
- type ResponseRecorder
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndpointWithAsyncTask ¶
func EndpointWithAsyncTask()
- with async after response - with body available after response Allows body to be read after response is sent
func EndpointWithCustomMiddlewares ¶
func EndpointWithCustomMiddlewares(name string, handler http.HandlerFunc, pre, post []http.HandlerFunc) http.Handler
- with custom middleware
func EndpointWithErrorHandler ¶
func EndpointWithErrorHandler()
- with error handling accordingly to API
func JSONEndpoint ¶
func JSONEndpoint(name string, handler http.HandlerFunc) http.Handler
Types ¶
type ResponseRecorder ¶
type ResponseRecorder struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseRecorder wraps a http.ResponseWriter to record its status code before the response is written. TODO: Explain why it does not matter to lose the rest of the default interfaces.
func NewResponseRecorder ¶
func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder
func (*ResponseRecorder) GetBody ¶
func (rw *ResponseRecorder) GetBody() []byte
func (*ResponseRecorder) GetStatusCode ¶
func (rw *ResponseRecorder) GetStatusCode() int
func (*ResponseRecorder) Header ¶
func (rw *ResponseRecorder) Header() http.Header
func (*ResponseRecorder) WriteHeader ¶
func (rw *ResponseRecorder) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.