apidoc

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 16 Imported by: 3

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 Dir = "./apidoc/"
View Source
var UriPrefix = "/apidoc"

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

Functions

func DefinitionsApi

func DefinitionsApi(definitions map[string]spec.Schema, v interface{})

func DocList

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

func GetDoc

func GetDoc(realPath, modName string) *spec.Swagger

参数为路径和格式

func Markdown

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

func NilDoc

func NilDoc()

func OpenApi

func OpenApi(mux *http.ServeMux, uriPrefix, dir string)

func Swagger

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