generator

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallApi

func CallApi(api ApiDoc)

func GenResponseExample

func GenResponseExample(tp spec.Type) string

func GenShowDoc

func GenShowDoc() error

Types

type ApiDoc

type ApiDoc struct {
	Desc            string     // 简要描述,标题
	Url             string     // 请求URL
	Method          string     // 请求方式
	Request         []Request  // 请求参数
	Response        []Response // 返回示例
	ResponseExample string     // 返回示例
	Memo            string     // 备注
	Group           string     // 所属
	// contains filtered or unexported fields
}

func MakeApiDoc

func MakeApiDoc(route spec.Route, group spec.Group) (api ApiDoc, err error)

func (*ApiDoc) MakeDoc

func (d *ApiDoc) MakeDoc() string

type Request

type Request struct {
	Name      string // 参数名
	IsRequire string // 是否必填
	Type      string // 类型
	Memo      string // 说明
}

type Response

type Response struct {
	Name string // 参数名
	Type string // 类型
	Memo string // 说明
}

Jump to

Keyboard shortcuts

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