Categorygithub.com/lazada/swgui
modulepackage
0.1.1
Repository: https://github.com/lazada/swgui.git
Documentation: pkg.go.dev

# README

Swagger UI

GoDoc

Package swgui (Swagger UI) provide a HTTP handler to serve Swagger UI. All assets are embedded in GO source code, so just build and run.

How to use

package main

import (
    "http"

    "github.com/lazada/swgui"
)

func main() {
    http.Handle("/", swgui.NewHandler("Page title", "path/to/swagger.json", "/"))
    http.ListenAndServe(":8080", nil)
}

Run as standalone server

Install swgui-server

go get github.com/lazada/swgui/...

Start server

swgui-server -port 8080

# Packages

No description provided by the author

# Functions

Asset loads and returns the asset for the given name.
AssetDir returns the file names below a certain directory embedded in the file by go-bindata.
AssetInfo loads and returns the asset info for the given name.
AssetNames returns the names of the assets.
MustAsset is like Asset but panics when Asset would return an error.
NewHandler returns a HTTP handler for swagger UI.
NewHandlerWithConfig returns a HTTP handler for swagger UI.
RestoreAsset restores an asset under the given directory.
RestoreAssets restores an asset under the given directory recursively.

# Structs

Handler handle swagger UI request.