generate

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(in Plugin) error

Types

type Bean

type Bean struct {
	ParentPackage string
	Name          stringx.String
	Import        string
	Members       []*Member
	PathTag       []string
	FormTag       []string
	JsonTag       []string
}

func (*Bean) GetMember

func (b *Bean) GetMember(name string) *Member

func (*Bean) GetQuery

func (b *Bean) GetQuery() string

func (*Bean) HavePath

func (b *Bean) HavePath() bool

func (*Bean) IsFormRequest

func (b *Bean) IsFormRequest() bool

func (*Bean) IsJsonRequest

func (b *Bean) IsJsonRequest() bool

type IService

type IService struct {
	ParentPackage string
	Import        string
	Routes        []*Route
}

type Member

type Member struct {
	Name     stringx.String
	TypeName string
	Comment  string
	Doc      string
}

type Plugin

type Plugin struct {
	Api           *spec.ApiSpec
	Style         string
	Dir           string
	ParentPackage string
}

func (*Plugin) Convert

func (p *Plugin) Convert() (*Spec, error)

func (*Plugin) SetParentPackage

func (p *Plugin) SetParentPackage(parentPackage string)

type Route

type Route struct {
	MethodName       string
	Method           string
	Path             string
	RequestBeanName  string
	ResponseBeanName string
	HasRequest       bool
	HasResponse      bool
	ShowRequestBody  bool
	HavePath         bool
	HaveQuery        bool
	PathId           string
	PathIdExpr       string
	QueryId          string
	QueryIdExpr      string
	Doc              string
}

type Spec

type Spec struct {
	Beans   []*Bean
	Service IService
}

type Tag

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

func NewTag

func NewTag(tagExpr string) *Tag

func (*Tag) GetTag

func (t *Tag) GetTag() string

func (*Tag) IsForm

func (t *Tag) IsForm() bool

func (*Tag) IsJson

func (t *Tag) IsJson() bool

func (*Tag) IsPath

func (t *Tag) IsPath() bool

type Type

type Type struct {
	Name string
}

Jump to

Keyboard shortcuts

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