Documentation
¶
Index ¶
- Variables
- func AfterScript(js string) func(*Config)
- func BeforeScript(js string) func(*Config)
- func DeepLinking(deepLinking bool) func(*Config)
- func DefaultModelsExpandDepth(defaultModelsExpandDepth ModelsExpandDepthType) func(*Config)
- func DocExpansion(docExpansion string) func(*Config)
- func DomID(domID string) func(*Config)
- func Handler(configFns ...func(*Config)) core.HandlerFunc
- func InstanceName(name string) func(*Config)
- func Layout(layout SwaggerLayout) func(*Config)
- func PersistAuthorization(persistAuthorization bool) func(*Config)
- func Plugins(plugins []string) func(*Config)
- func ShowExtensions(showExtensions bool) func(config *Config)
- func UIConfig(props map[string]string) func(*Config)
- func URL(url string) func(*Config)
- type Config
- type ModelsExpandDepthType
- type SwaggerLayout
Constants ¶
This section is empty.
Variables ¶
var WrapHandler = Handler()
WrapHandler wraps swaggerFiles.Handler and returns http.HandlerFunc.
Functions ¶
func AfterScript ¶
AfterScript holds JavaScript to be run right after the Swagger UI object is created and set on the window.
func BeforeScript ¶
BeforeScript holds JavaScript to be run right before the Swagger UI object is created.
func DefaultModelsExpandDepth ¶
func DefaultModelsExpandDepth(defaultModelsExpandDepth ModelsExpandDepthType) func(*Config)
DefaultModelsExpandDepth presents the model of response and request. set the default expansion depth for models
func DocExpansion ¶
DocExpansion list, full, none.
func Handler ¶
func Handler(configFns ...func(*Config)) core.HandlerFunc
Handler wraps `http.Handler` into `http.HandlerFunc`.
func InstanceName ¶
InstanceName set the instance name that was used to generate the swagger documents Defaults to swag.Name ("swagger").
func Layout ¶
func Layout(layout SwaggerLayout) func(*Config)
Define Layout options are BaseLayout or StandaloneLayout
func PersistAuthorization ¶
PersistAuthorization Persist authorization information over browser close/refresh. Defaults to false.
func ShowExtensions ¶
ShowExtensions controls the display of vendor extension (x-) fields and values for Operations, Parameters, Responses, and Schema.
func UIConfig ¶
UIConfig specifies additional SwaggerUIBundle config object properties. UIConfig returns a function that configures the swagger UI with custom properties. The input props map is converted to use template.JS type for both keys and values to ensure safe usage in HTML templates. The returned function sets these properties in the provided Config's UIConfig field.
Types ¶
type Config ¶
type Config struct {
// The url pointing to API definition (normally swagger.json or swagger.yaml). Default is `doc.json`.
URL string
DocExpansion string
DomID string
InstanceName string
BeforeScript template.JS
AfterScript template.JS
Plugins []template.JS
UIConfig map[template.JS]template.JS
DeepLinking bool
PersistAuthorization bool
Layout SwaggerLayout
DefaultModelsExpandDepth ModelsExpandDepthType
ShowExtensions bool
Dir string
}
Config stores httpSwagger configuration variables.
type ModelsExpandDepthType ¶
type ModelsExpandDepthType int
const ( ShowModel ModelsExpandDepthType = 1 HideModel ModelsExpandDepthType = -1 )
type SwaggerLayout ¶
type SwaggerLayout string
const ( BaseLayout SwaggerLayout = "BaseLayout" StandaloneLayout SwaggerLayout = "StandaloneLayout" )