knife4go

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomWrapHandler

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

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

func DeepLinking

func DeepLinking(deepLinking bool) func(*Config)

DeepLinking set the swagger deep linking configuration.

func DefaultModelsExpandDepth

func DefaultModelsExpandDepth(depth int) func(*Config)

DefaultModelsExpandDepth set the default expansion depth for models (set to -1 completely hide the models).

func DisablingCustomWrapHandler

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

DisablingCustomWrapHandler turn handler off if specified environment variable passed.

func DisablingWrapHandler

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

DisablingWrapHandler turn handler off if specified environment variable passed.

func DocExpansion

func DocExpansion(docExpansion string) func(*Config)

DocExpansion list, full, none.

func InstanceName

func InstanceName(name string) func(*Config)

InstanceName set the instance name that was used to generate the swagger documents Defaults to swag.Name ("swagger").

func Oauth2DefaultClientID

func Oauth2DefaultClientID(oauth2DefaultClientID string) func(*Config)

Oauth2DefaultClientID set the default client ID used for OAuth2

func PersistAuthorization

func PersistAuthorization(persistAuthorization bool) func(*Config)

PersistAuthorization Persist authorization information over browser close/refresh. Defaults to false.

func URL

func URL(url string) func(*Config)

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

func WrapHandler

func WrapHandler(handler *webdav.Handler, options ...func(*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
	DocExpansion             string
	InstanceName             string
	Title                    string
	DefaultModelsExpandDepth int
	DeepLinking              bool
	PersistAuthorization     bool
	Oauth2DefaultClientID    string
}

Config stores ginSwagger configuration variables.

Jump to

Keyboard shortcuts

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