http-swagger
默认的net / http包装器,可通过Swagger 2.0自动生成RESTful API文档。
用法
开始使用它
将注释添加到您的API源代码中,。
使用以下方法下载 for Go:
$ go get github.com/swaggo/swag/cmd/swag
在包含main.go文件的Go项目根文件夹中运行 , 将解析注释并生成所需文件( docs文件夹和docs/doc.go )。
$ swag init
4,使用以下命令下载 :
$ go get -u github.com/swaggo/http-swagger
并在您的代码中导入以下内容:
import "github.com/swaggo/http-swagger" // http-swagger middleware
规范示例:
package main
import (
评论0
最新资源