ginSwagger

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomWrapHandler

func CustomWrapHandler(config *Config, h *webdav.Handler) gin.HandlerFunc

CustomWrapHandler wraps `http.Handler` into `gin.HandlerFunc`

func DeepLinking

func DeepLinking(deepLinking bool) func(c *Config)

DeepLinking set the swagger deeplinking configuration

func DisablingCustomWrapHandler

func DisablingCustomWrapHandler(config *Config, h *webdav.Handler, envName string) gin.HandlerFunc

DisablingCustomWrapHandler turn handler off if specified environment variable passed

func DisablingWrapHandler

func DisablingWrapHandler(h *webdav.Handler, envName string) gin.HandlerFunc

DisablingWrapHandler turn handler off if specified environment variable passed

func OAuth

func OAuth(oauth *OAuthConfig) func(c *Config)

OAuth set the swagger oauth configuration

func OAuth2RedirectURL

func OAuth2RedirectURL(url string) func(c *Config)

func URL

func URL(url string) func(c *Config)

URL presents the url pointing to API definition (normally swagger.json or swagger.yaml).

func WrapHandler

func WrapHandler(h *webdav.Handler, confs ...func(c *Config)) gin.HandlerFunc

WrapHandler wraps `http.Handler` into `gin.HandlerFunc`.

Types

type Config

type Config struct {
	//The url pointing to API definition (normally swagger.json or swagger.yaml). Default is `doc.json`.
	URL               string
	DeepLinking       bool
	OAuth             *OAuthConfig
	OAuth2RedirectURL string
}

Config stores ginSwagger configuration variables.

type OAuthConfig

type OAuthConfig struct {
	// The ID of the client sent to the OAuth2 IAM provider.
	ClientId string
	// 🚨 Never use this parameter in your production environment. It exposes cruicial security information. This feature is intended for dev/test environments only. 🚨
	// Default clientSecret. MUST be a string
	ClientSecret string
	// The OAuth2 realm that the client should operate in. If not applicable, use empty string.
	Realm string
	// The name to display for the application in the authentication popup.
	AppName string
}

Configuration for Swagger UI OAuth2 integration. See https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/ for further details.

Jump to

Keyboard shortcuts

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