plugin

package
v0.0.1-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 14 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 NewRestPlugin

func NewRestPlugin(annotation string, opts ...Opt) *restPlugin

Types

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
	Methods        []*Method
}

type Method

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

type Opt

type Opt func(*restPlugin)

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