swagger

package
v0.0.0-...-f0a7105 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(title, swaggerJSONPath string, basePath string) http.Handler

New creates HTTP handler for Swagger UI.

func NewWithOption

func NewWithOption(handlerOpts ...HandlerOption) http.Handler

NewWithOption creates configurable handler constructor.

func RegisterSwaggerUIServer

func RegisterSwaggerUIServer[T httpServerInterface](srv T, title, swaggerJSONPath string, basePath string)

func RegisterSwaggerUIServerWithOption

func RegisterSwaggerUIServerWithOption[T httpServerInterface](srv T, handlerOpts ...HandlerOption)

Types

type Handler

type Handler = handler2.Handler

Handler handles swagger UI request.

type HandlerOption

type HandlerOption func(opt *handler.Config)

func WithBasePath

func WithBasePath(path string) HandlerOption

WithBasePath Base URL to docs.

func WithHideCurl

func WithHideCurl(hide bool) HandlerOption

WithHideCurl Hide curl code snippet

func WithJsonEditor

func WithJsonEditor(enable bool) HandlerOption

WithJsonEditor Enable visual json editor support (experimental, can fail with complex schemas).

func WithLocalFile

func WithLocalFile(filePath string) HandlerOption

func WithMemoryData

func WithMemoryData(data []byte, ext string) HandlerOption

func WithPreAuthorizeApiKey

func WithPreAuthorizeApiKey(keys map[string]string) HandlerOption

WithPreAuthorizeApiKey Map of security name to key value

func WithRemoteFile

func WithRemoteFile(filePath string) HandlerOption

WithRemoteFile URL to openapi.json/swagger.json document specification.

func WithSettingsUI

func WithSettingsUI(settings map[string]string) HandlerOption

WithSettingsUI contains keys and plain javascript values of SwaggerUIBundle configuration. Overrides default values. See https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ for available options.

func WithShowTopBar

func WithShowTopBar(show bool) HandlerOption

WithShowTopBar Show navigation top bar, hidden by default.

func WithTitle

func WithTitle(title string) HandlerOption

WithTitle Title of index file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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