hertzSwagger

package module
v0.0.0-...-ac678a1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

hertz-swagger

Hertz middleware to automatically generate RESTful API documentation with Swagger 2.0.

This repo has been moved into hertz-contrib

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomWrapHandler

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

CustomWrapHandler wraps `http.Handler` into `app.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 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)) app.HandlerFunc

WrapHandler wraps `http.Handler` into `app.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 hertzSwagger configuration variables.

Directories

Path Synopsis
example
basic/docs
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

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