openapi

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomResponder

type CustomResponder struct {
	Body       []byte
	Header     map[string]string
	StatusCode int
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL