apidoc

package
v1.10.10 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MarkDownEXT = ".apidoc.md"
View Source
const SwaggerEXT = ".swagger.json"
View Source
const TypeMarkdown = "markdown"
View Source
const TypeSwagger = "swagger"

Variables

View Source
var ApiDocDir = "./api/"
View Source
var UriPrefix = "/api-doc"

目录结构 ./api/mod/mod.swagger.json ./api/mod/mod.apidoc.md 请求路由 /api-doc /api-doc/swagger/mod/mod.swagger.json /api-doc/markdown/mod/mod.apidoc.md

Functions

func DocList added in v1.10.8

func DocList(w http.ResponseWriter, r *http.Request)

func GetDoc

func GetDoc(path string) *spec.Swagger

参数为路径和格式

func Markdown added in v1.10.8

func Markdown(w http.ResponseWriter, r *http.Request)

func NilDoc

func NilDoc()

func OpenApi added in v1.10.8

func OpenApi(mux *http.ServeMux, filePath string)

func Swagger added in v1.10.8

func Swagger(w http.ResponseWriter, r *http.Request)

func WriteToFile

func WriteToFile(realPath, modName string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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