# Packages
No description provided by the author
No description provided by the author
No description provided by the author
Package middleware provides the library with helper functions for serving swagger APIs.
No description provided by the author
No description provided by the author
# Functions
AllowsBody returns true if the request allows for a body.
ByteStreamConsumer creates a consumer for byte streams.
ByteStreamProducer creates a producer for byte streams.
CanHaveBody returns true if this method can have a body.
ClosesStream when the bytestream consumer or producer is finished.
ContentType parses a content type header.
CSVConsumer creates a new CSV consumer.
CSVProducer creates a new CSV producer.
HasBody returns true if this method needs a content-type.
IsSafe returns true if this is a request with a safe method.
JSONConsumer creates a new JSON consumer.
JSONProducer creates a new JSON producer.
JSONRequest creates a new http request with json headers set.
NamedReader creates a NamedReadCloser for use as file upload.
NewAPIError creates a new API error.
ReadCollectionValue reads a collection value from a string data source.
ReadSingleValue reads a single value from the source.
TextConsumer creates a new text consumer.
TextProducer creates a new text producer.
No description provided by the author
WithCSVReaderOpts specifies the options to csv.Reader when reading CSV.
WithCSVSkipLines will skip header lines.
WithCSVWriterOpts specifies the options to csv.Writer when writing CSV.
XMLConsumer creates a new XML consumer.
XMLProducer creates a new XML producer.
# Constants
CSVMime the csv mime type.
DefaultMime the default fallback mime type.
HeaderAccept the Accept header.
HeaderAuthorization the Authorization header.
HeaderContentType represents a http content-type header, it's value is supposed to be a mime type.
HeaderTransferEncoding represents a http transfer-encoding header.
HTMLMime the html mime type.
JSONMime the json mime type.
MultipartFormMime the multipart form mime type.
TextMime the text mime type.
URLencodedFormMime the url encoded form mime type.
XMLMime the xml mime type.
YAMLMime the yaml mime type.
# Variables
DiscardConsumer does absolutely nothing, it's a black hole.
DiscardProducer does absolutely nothing, it's a black hole.
Statuses lists the most common HTTP status codes to default message taken from https://httpstatuses.com/.
# Structs
APIError wraps an error model and captures the status code.
ClientOperation represents the context for a swagger operation to be submitted to the transport.
No description provided by the author
# Interfaces
Authenticator represents an authentication strategy implementations of Authenticator know how to authenticate the request data and translate that into a valid principal object or an error.
Authorizer represents an authorization strategy implementations of Authorizer know how to authorize the principal object using the request data and returns error if unauthorized.
A ClientAuthInfoWriter implementor knows how to write authentication info to a request.
ClientRequest is an interface for things that know how to add information to a swagger client request.
ClientRequestWriter is an interface for things that know how to write to a request.
A ClientResponse represents a client response This bridges between responses obtained from different transports.
A ClientResponseReader is an interface for things want to read a response.
A ClientResponseStatus is a common interface implemented by all responses on the generated code You can use this to treat any client response based on status code.
A ClientTransport implementor knows how to submit Request objects to some destination.
Consumer implementations know how to bind the values on the provided interface to data provided by the request body.
ContextValidatable types implementing this interface allow customizing their validation this will be used instead of the reflective validation based on the spec document.
No description provided by the author
No description provided by the author
Gettable for things with a method GetOK(string) (data string, hasKey bool, hasValue bool).
NamedReadCloser represents a named ReadCloser interface.
OperationHandler a handler for a swagger operation.
Producer implementations know how to turn the provided interface into a valid HTTP response.
Validatable types implementing this interface allow customizing their validation this will be used instead of the reflective validation based on the spec document.
# Type aliases
AuthenticatorFunc turns a function into an authenticator.
AuthorizerFunc turns a function into an authorizer.
A ClientAuthInfoWriterFunc converts a function to a request writer interface.
ClientRequestWriterFunc converts a function to a request writer interface.
A ClientResponseReaderFunc turns a function into a ClientResponseReader interface implementation.
ConsumerFunc represents a function that can be used as a consumer.
CSVOpts alter the behavior of the CSV consumer or producer.
No description provided by the author
OperationHandlerFunc an adapter for a function to the OperationHandler interface.
ProducerFunc represents a function that can be used as a producer.
Values typically represent parameters on a http request.