swagger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package swagger contains generated code from the Swagger spec.

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

WithRequestIDTrailerTransport returns a new RequestIDTrailerTransport that wraps the given http.RoundTripper. If rt is nil, http.DefaultTransport is used.

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)

RoundTrip implements the http.RoundTripper interface. It extracts the request ID from the response headers if it is available.

type RequestIDer

type RequestIDer interface {
	RequestID() string
}

RequestIDer is an interface for types that have a request ID.

Jump to

Keyboard shortcuts

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