Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomResponder ¶
CustomResponder is a go-swagger compatible struct that allows the caller to fully customize the HTTP response. The caller can define the response body, header, and status code.
func NewCustomResponder ¶
func NewCustomResponder(body []byte, header map[string]string, statusCode int) *CustomResponder
NewCustomResponder creates a new CustomResponder with the given body, header, and status code.
func (*CustomResponder) WriteResponse ¶
func (c *CustomResponder) WriteResponse(writer http.ResponseWriter, producer runtime.Producer)
WriteResponse writes the defined HTTP response to the provided ResponseWriter.
It sets the response headers, status code, and body. If an error occurs while writing the body, the error is logged to Stderr. Note: runtime.Producer is ignored.
type PayloadResponder ¶ added in v0.2.9
type PayloadResponder struct { StatusCode int Payload interface{} }
func NewPayloadResponder ¶ added in v0.2.9
func NewPayloadResponder(statusCode int, payload interface{}) *PayloadResponder
func (*PayloadResponder) WriteResponse ¶ added in v0.2.9
func (p *PayloadResponder) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
Click to show internal directories.
Click to hide internal directories.