Documentation
¶
Overview ¶
Copyright (c) 2021 Cisco Systems, Inc and its affiliates All Rights reserved
Copyright (c) 2021 Cisco Systems, Inc and its affiliates All Rights reserved
Copyright (c) 2021 Cisco Systems, Inc and its affiliates All Rights reserved
Copyright (c) 2021 Cisco Systems, Inc and its affiliates All Rights reserved
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentationConfig ¶
type DocumentationConfig struct { RootPath string ApiPath string `config:"default=/apidocs.json"` SwaggerPath string `config:"default=/swagger-resources"` SpecVersion string `config:"default=3.0.0"` Security Security Ui struct { Endpoint string `config:"default=/swagger"` View string `config:"default=/swagger-ui.html"` } }
DocumentationConfig is the config used to configure your swagger Key config elements are: RootPath is the base path your application is serving from defaults to / UI.Endpoint is the path you are serving swagger from defaults to /swagger and is concatinated with RootPath when accessing from the browser Security.Enabled flags Oauth on or off Security.Sso.BaseUrl is the path to MSX Usermanagment Service should be changed
type MsxSwagger ¶ added in v1.0.12
type MsxSwagger struct {
// contains filtered or unexported fields
}
MsxSwagger contains all required information to serve a swagger page config is a pointer to a MsxSwaggerConfig spec is an openapi Swagger spec fileSystem is an http fileSystem
func NewMsxSwagger ¶ added in v1.0.12
func NewMsxSwagger(cfg *MsxSwaggerConfig) (*MsxSwagger, error)
NewMsxSwagger take a MsxSwaggerConfig and returns a MsxSwagger Object Will return an error if provided swagger.json file is not parsable
func (*MsxSwagger) SwaggerRoutes ¶ added in v1.0.12
func (p *MsxSwagger) SwaggerRoutes(w http.ResponseWriter, r *http.Request)
SwaggerRoutes is an http.Handlefunc that serves MsxSwagger As this function must handle multiple paths it must be served from a handler that supports wildcard paths mount path must match values configured in MsxSwagger config RootPath + UI.Endpoint
type MsxSwaggerConfig ¶ added in v1.0.14
type MsxSwaggerConfig struct { SwaggerJsonPath string AppInfo AppInfo DocumentationConfig DocumentationConfig }
MsxSwaggerConfig represents a MsxSwagger config object SwaggerJsonPath is the path to your openapi json file.
func NewDefaultMsxSwaggerConfig ¶ added in v1.0.16
func NewDefaultMsxSwaggerConfig() *MsxSwaggerConfig