README ¶
knife4go
simply Assembled knife4j + gin-swagger, it means an enhanced version of gin-swagger with nice UI.
work well on go1.18+
go get
go get github.com/go-webtools/knife4go
usage
Based on the usage of gin-swagger, add sth as follows:
import (
knife4goGin "github.com/go-webtools/knife4go/gin"
knife4goFiles "github.com/go-webtools/knife4go"
...
swaggerFiles "github.com/swaggo/files" // swagger embed files
ginSwagger "github.com/swaggo/gin-swagger" // gin-swagger middleware
)
func InitRouters() *gin.Engine {
router := gin.Default()
// swagger base router
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
// knife4go: beautify swagger-ui
router.GET("/knife4go/*any", knife4goGin.WrapHandler(knife4goFiles.Handler))
...
}
Disclaimer
Public welfare projects.
The disclaimer asserts that the individual won't be held responsible for any.
MIT LICENSE
Links
- gin-swagger: https://github.com/swaggo/gin-swagger
- knife4j: https://github.com/xiaoymin/knife4j
- swag: https://github.com/swaggo/swag/cmd/swag
Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CTX is a context for webdav vfs CTX = context.Background() // FS is a virtual memory file system FS = webdav.NewMemFS() // Handler is used to server files through a http handler Handler *webdav.Handler // HTTP is the http file system HTTP http.FileSystem = new(HTTPFS) )
Functions ¶
Types ¶
Source Files ¶
- ab0x.go
- b0xfile__axios.min.js.go
- b0xfile__chunk-0b510f4b.a9ffbfcb.css.go
- b0xfile__chunk-0b510f4b.d676e2ca.js.go
- b0xfile__chunk-0d102d5a.e684de54.js.go
- b0xfile__chunk-0fd67716.7c05a478.js.go
- b0xfile__chunk-129cbef4.a2947293.js.go
- b0xfile__chunk-214218f0.e57955ea.js.go
- b0xfile__chunk-2d0af44e.83f5fff8.js.go
- b0xfile__chunk-2d0bd799.f81fc7d8.js.go
- b0xfile__chunk-2d0da532.360126eb.js.go
- b0xfile__chunk-3b888a65.4da69ee0.js.go
- b0xfile__chunk-589faee0.d56965ec.js.go
- b0xfile__chunk-735c675c.d8905482.js.go
- b0xfile__chunk-845d989c.20e6d994.css.go
- b0xfile__chunk-845d989c.7d4dfe1a.js.go
- b0xfile__chunk-9aa77aca.49424edb.js.go
- b0xfile__chunk-adb9e944.a3f9d0d8.js.go
- b0xfile__chunk-vendors.4e708c1b.js.go
- b0xfile__chunk-vendors.f24a310a.css.go
- b0xfile__doc.html.go
- b0xfile__favicon.ico.go
- b0xfile__main.a93a5ea8.css.go
- b0xfile__main.js.go
- b0xfile__oauth2.html.go
- b0xfile__openapi.json.go
- common.go
Click to show internal directories.
Click to hide internal directories.