Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// URLPath is the path at which swagger ui will be served at
URLPath string
// ShouldRender is used to signal to the middleware whether or not to serve
// swagger ui (Ex. expose swagger ui in non production environments, while not rendering in production)
ShouldRender bool
// SwaggerSpecURL is the url swagger ui will try to resolve a valid specifcation file from
SwaggerSpecURL string
}
Config is an object intended to be used to configure an instance of a swag server middle ware
type Middleware ¶
Middleware is a simple alias for a commonmiddle ware function signature, func(next http.Handler) http.Handler
func New ¶
func New(config ...Config) Middleware
New is the factory constructor for intializing a SwagServer middleware It takes an optional SwagServerConfig object as its single argument. If used without providing a config object, it will intialize the middleware using default settings:
UrlPath: "/swagger/" ShouldRender: true SpecUrl: "/swagger.json"
Click to show internal directories.
Click to hide internal directories.