gen

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gin = "gin"
	Chi = "chi"
	Mux = "mux"
)

Variables

View Source
var InTypeMap = map[string]string{
	"json":     "body",
	"path":     "path",
	"postform": "formData",
	"mpfd":     "formData",
	"header":   "header",
	"getform":  "query",
}
View Source
var MineTypeMap = map[string]string{
	"json":        "application/json",
	"xml":         "application/xml",
	"html":        "text/html",
	"text":        "text/plain",
	"form":        "application/x-www-form-urlencoded",
	"mpfd":        "multipart/form-data",
	"jsonapi":     "application/vnd.api+json",
	"jsonstream":  "application/x-json-stream",
	"octetstream": "application/octet-stream",
	"png":         "image/png",
	"jpeg":        "image/jpeg",
	"gif":         "image/gif",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	//Host api request address
	Host string

	//Dir the folder path of the generated doc.go
	Dir string

	//BasePath url request prefix
	BasePath string

	//WebFrame such as http,gin
	WebFrame string

	//Cover auto cover generation
	Cover bool

	//Router auto gen router info
	Router bool
}

Config presents Gen configurations.

type Debugger

type Debugger interface {
	Printf(format string, v ...interface{})
}

Debugger is the interface that wraps the basic Printf method.

type FileGenConfig

type FileGenConfig struct {
	// contains filtered or unexported fields
}

FileGenConfig file creation configuration

type Gen

type Gen struct {
	// contains filtered or unexported fields
}

Gen presents a generate tool for swag.

func New

func New(config *Config) *Gen

func (*Gen) DoGen

func (g *Gen) DoGen() error

type Parser

type Parser struct {
	Swagger   *openapi.Swagger
	Plugin    *plugin.Plugin
	RouterMap map[string]RouteInfos
	// contains filtered or unexported fields
}

func NewParser

func NewParser(p *plugin.Plugin) *Parser

type RouteGroup added in v1.5.6

type RouteGroup struct {
	GroupName string
}

type RouteInfos added in v1.5.6

type RouteInfos struct {
	Method     string //  method
	Path       string //  path
	BasePath   string //  BasePath
	HandlerFun string //  handlerFun
	Summary    string //  Summary
	Public     bool   //  is public router
	RouteGroup
}

type SwaggerGroupObject

type SwaggerGroupObject struct {
	Name           string `json:"name"`
	Url            string `json:"url"`
	SwaggerVersion string `json:"swaggerVersion"`
	Location       string `json:"location"`
}

SwaggerGroupObject Microservices Documentation Group

Jump to

Keyboard shortcuts

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