serveswagger

package
v0.0.0-...-9244570 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultAddr = "localhost:8080"

DefaultAddr holds default localhost info

Variables

View Source
var SwaggerParams = common.ConstParams{
	Year:      time.Now().Year(),
	Logo:      "https://raw.githubusercontent.com/swaggo/swag/master/assets/swaggo.png",
	Framework: "Go-Swagger",
	Addr:      DefaultAddr,
}

SwaggerParams holds default ConstParams for the go-swagger executable

Functions

func HTMLProducer

func HTMLProducer(w io.Writer, data interface{}) error

HTMLProducer is required by swagger in order for the generated server be able to produce the mime type "text/html". The runtime.Producer argument of each handler for the server relies on it to render the pages for the UI.

func RouteHandler

func RouteHandler(rt common.Route, pd *common.ConstParams, req *http.Request) middleware.Responder

RouteHandler returns a middleware.Responder that serves our html and the vulnerable functions.

func Setup

func Setup() (*restapi.Server, error)

Setup sets up the configuration for the go-swagger server

func SwaggerRootHandler

func SwaggerRootHandler(params swagger_server.RootParams) middleware.Responder

SwaggerRootHandler handles the main page of the go-swagger server

Types

This section is empty.

Directories

Path Synopsis
Package shared contains functionality used by `cmd/swagger` at runtime and by `cmd/swagger/regen`.
Package shared contains functionality used by `cmd/swagger` at runtime and by `cmd/swagger/regen`.

Jump to

Keyboard shortcuts

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