package
module
Version:
v0.0.0-...-dc6e6a6
Opens a new window with list of versions in this module.
Published: Mar 7, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Knife4g
use knife4j-front to show the api documents for gin
Usage
- Add comments to your API source code
- Download Swag for Go by using:
- Run
swag init -ot json
in your project directory
- Run
go get github.com/hononet639/knife4g
- Add router to your gin project
example:
package main
import (
"github.com/gin-gonic/gin"
"github.com/hononet639/knife4g"
)
func main() {
engine := gin.Default()
engine.GET("/doc/*any", knife4g.Handler(knife4g.Config{RelativePath: "/doc"}))
engine.Run(":80")
}
- Visit http://localhost/doc/index
Acknowledgement
Thanks to knife4j
Documentation
¶
type Config struct {
RelativePath string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.