Render hook

The render hook is the last call of KCD, it takes the response returned by your handler and sends a marshaled version of the output back to the client with the default status code provided by the kcd.handler.

A render hook must have this signature:

type RenderHook func(w http.ResponseWriter, r *http.Request, response interface{}, defaultStatusCode int) error
circle-info

Check out the default render hook implementation herearrow-up-right.

Check out the signature of the RenderHookarrow-up-right.

Here you will find an example of render hook redefinition.

Last updated

Was this helpful?