api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:                   "api",
	Usage:                  "生成 api 数据",
	UseShortOptionHandling: true,

	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "input",
			Usage:   "输入目录或文件,多目录或文件用逗号分隔",
			Aliases: []string{"i"},
		},
		&cli.StringFlag{
			Name:    "output",
			Usage:   "输出文件名称",
			Aliases: []string{"o"},
		},
	},
	Action: action,
}

Functions

This section is empty.

Types

type Api

type Api struct {
	Method string
	Path   string
	Title  string
}

type ApiBody

type ApiBody struct {
	ApiParam
}

type ApiDefine

type ApiDefine struct {
	Flag        bool
	Name        string
	Title       string
	Description string
}

type ApiDeprecated

type ApiDeprecated struct {
	Flag bool
	Msg  string
}

type ApiDescription

type ApiDescription struct {
	Description string
}

type ApiError

type ApiError struct {
	ApiSuccess
}

type ApiGroup

type ApiGroup struct {
	Name string
}

type ApiHeader

type ApiHeader struct {
	Type        string
	Group       string
	Field       string
	Description string
	Default     interface{}
}

type ApiIgnore

type ApiIgnore struct {
	Flag bool
	Msg  string
}

type ApiName

type ApiName struct {
	Name string
}

type ApiParam

type ApiParam struct {
	Type        string
	Group       string
	Field       string
	Description string
	Rang        [2]int
	Enum        []interface{}
	Default     interface{}
}

type ApiPermission

type ApiPermission struct {
	Name string
}

type ApiPrivate

type ApiPrivate struct {
	Flag bool
}

type ApiQuery

type ApiQuery struct {
	ApiParam
}

type ApiSuccess

type ApiSuccess struct {
	Type        string
	Group       string
	Field       string
	Description string
}

type ApiUse

type ApiUse struct {
	Flag bool
	Name string
}

type ApiVersion

type ApiVersion struct {
	Version string
}

type Element

type Element struct {
	Api
	GroupName string
	ApiVersion
	ApiName
	ApiDescription
	Ignore     ApiIgnore
	Deprecated ApiDeprecated
	Private    ApiPrivate
	Params     []*ApiParam
	Query      []*ApiQuery
	Body       []*ApiBody
	Success    []*ApiSuccess
	Header     []*ApiHeader
	Error      []*ApiError
	Permission []*ApiPermission
	Define     ApiDefine
	Use        []*ApiUse
}

func DependencyInjection

func DependencyInjection(ele []*Element) []*Element

分析依赖链并注入

func Parse

func Parse(data string) (apis []*Element)

Jump to

Keyboard shortcuts

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