Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJSONEncoder ¶
func NewJSONEncoder() middleware.Middleware
NewJSONEncoder creates a new response middleware
func WithPayload ¶
WithPayload adds payload to the given context
Types ¶
type Buffer ¶
type Buffer struct { Response http.ResponseWriter Status int Body *bytes.Buffer }
Buffer implements ResponseWriter interface and can be used to collect the response body in a middleware handlers.
func NewBuffer ¶
func NewBuffer(w http.ResponseWriter) *Buffer
NewBuffer create a new response buffer
func (*Buffer) WriteHeader ¶
WriteHeader stores the status code
Click to show internal directories.
Click to hide internal directories.