swagger

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TextConsumer

func TextConsumer() runtime.Consumer

TextConsumer creates a new text consumer.

Specifically we attempt to deal with the case here where nginx returns a 500 that is HTML, so we can't unmarshal into our RuntimeError object. In the case HTML is returned, we set the error's message field to the HTML body.

func WithRequestIDTrailerTransport

func WithRequestIDTrailerTransport(rt http.RoundTripper) http.RoundTripper

Types

type RequestIDBody

type RequestIDBody struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

RequestIDBody wraps an io.ReadCloser, essentially an http body, with a request ID.

func (RequestIDBody) RequestID

func (r RequestIDBody) RequestID() string

RequestID returns the requestID for the request.

type RequestIDTrailerTransport

type RequestIDTrailerTransport struct {
	RT http.RoundTripper
}

RequestIDTrailerTransport pulls out the request ID from response trailer and overwrites the (http.Response).Body to be a RequestIDBody.

func (RequestIDTrailerTransport) RoundTrip

func (r RequestIDTrailerTransport) RoundTrip(req *http.Request) (*http.Response, error)

type RequestIDer

type RequestIDer interface {
	RequestID() string
}

Jump to

Keyboard shortcuts

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