swaggerui

package module
v3.20.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: MIT Imports: 1 Imported by: 4

README

Go Packr Swagger UI

This is just a go file containing the dist folder of the swagger-api/swagger-ui.

Usage

package main

import "github.com/jmattheis/go-packr-swagger-ui"

func main() {
   box := swaggerui.GetBox()
}

Usage with gin-gonic/gin

package main

import (
    "github.com/jmattheis/go-packr-swagger-ui"
    "net/http"
)

func main() {
   box := swaggerui.GetBox()
   router := gin.New()
   g.GET("/docs/*any", gin.WrapH(http.StripPrefix("/docs/", http.FileServer(box))))
   g.GET("/swagger", yourSwaggerDefinition)
   router.Run()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBox

func GetBox() packr.Box

GetBox returns the box with the swagger ui files

Types

This section is empty.

Jump to

Keyboard shortcuts

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