apidoc

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 14 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 = "./apidoc/"
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 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, filePath 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