plugin

package
v0.0.1-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestTypePath   = "path"
	RequestTypeQuery  = "query"
	RequestTypeHeader = "header"
	RequestTypeBody   = "body"
)

Variables

This section is empty.

Functions

func MergeComments

func MergeComments(t *types.Type) []string

func NewGinPlugin

func NewGinPlugin(annotation string, opts ...Opt) *ginPlugin

func NewWebPluginManager

func NewWebPluginManager(annotation string, opts ...Opt) *pluginManager

Types

type ApiOperationMarker

type ApiOperationMarker struct {
	Value  string `marker:"value"`
	Notes  string `marker:"notes,optional"`
	Tags   string `marker:"tags,optional"`
	Router string `marker:"router,optional"`
}

func (ApiOperationMarker) Help

type AutoFillParamFunc

type AutoFillParamFunc func(imports namer.ImportTracker, name string, param *types.Type) (*TypeMeta, error)

type ControllerMarker

type ControllerMarker struct {
	Value string `marker:"value,optional"`
}

func (ControllerMarker) Help

type GinMetadata

type GinMetadata struct {
	Name           string
	TypeName       string
	Controller     ControllerMarker
	RequestMapping RequestMappingMarker
	LogHttpMarker  *LogHttpMarker
	Methods        []*Method
}

type LogHttpMarker

type LogHttpMarker struct {
	NoRequestHeader  bool   `marker:"norequestheader,optional"`
	NoRequestBody    bool   `marker:"norequestbody,optional"`
	NoResponseHeader bool   `marker:"noresponseheader,optional"`
	NoResponseBody   bool   `marker:"noresponsebody,optional"`
	Level            string `marker:"level,optional"` // debug | info | warn
}

func NewLogHttpMarker

func NewLogHttpMarker() *LogHttpMarker

func (*LogHttpMarker) Fill

func (m *LogHttpMarker) Fill() *LogHttpMarker

func (LogHttpMarker) Help

type Method

type Method struct {
	Name               string
	Params             []*TypeMeta
	Returns            []*TypeMeta
	RequestMapping     RequestMappingMarker
	LogHttpMarker      *LogHttpMarker
	ApiOperationMarker *ApiOperationMarker
}

type Opt

type Opt func(*ginPlugin)

func SetAutoFillParamFunc

func SetAutoFillParamFunc(f AutoFillParamFunc) Opt

type PathVariableMarker

type PathVariableMarker struct {
	Name     string `marker:"name"`
	Default  string `marker:"default,optional"`
	Required bool   `marker:"required,optional"`
}

func (PathVariableMarker) Help

type RequestBodyMarker

type RequestBodyMarker struct {
	markerdefs.Flag `marker:",optional"`
	Name            string `marker:"name"`
	Required        bool   `marker:"required,optional"`
}

func (RequestBodyMarker) Help

type RequestHeaderMarker

type RequestHeaderMarker struct {
	Name     string `marker:"name"`
	Default  string `marker:"default,optional"`
	Required bool   `marker:"required,optional"`
}

func (RequestHeaderMarker) Help

type RequestMappingMarker

type RequestMappingMarker struct {
	markerdefs.Flag `marker:",optional"`
	Value           string `marker:"value,optional"`
	Method          string `marker:"method,optional"`
	Consumes        string `marker:"consumes,optional"`
	Produces        string `marker:"produces,optional"`
}

func (RequestMappingMarker) Help

type RequestParamMarker

type RequestParamMarker struct {
	Name     string `marker:"name"`
	Default  string `marker:"default,optional"`
	Required bool   `marker:"required,optional"`
}

func (RequestParamMarker) Help

type RequestType

type RequestType string

type TypeMeta

type TypeMeta struct {
	Name        string
	TypeName    string
	Default     string
	Required    bool
	RequestType RequestType
}

Jump to

Keyboard shortcuts

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