controller

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FsApiExtract added in v1.4.3

func FsApiExtract(controller web.FsController, handler func(apiInfo web.ApiInfo, svm web.ServiceMethod))

func HandleFsApi added in v1.3.4

func HandleFsApi(controller web.Controller, handler func(prefix, dir string))

func NewApiInfo added in v1.3.7

func NewApiInfo(group string, field reflect.StructField, svm *ServiceMethod) web.ApiInfo

func NewEndpoint added in v1.3.7

func NewEndpoint(controller web.Controller) []web.Endpoint

func RestApiExtract added in v1.4.0

func RestApiExtract(controller web.Controller, handler func(apiInfo web.ApiInfo, svm web.ServiceMethod))

Types

type ApiInfo added in v1.3.7

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

func (*ApiInfo) GetDescription added in v1.3.7

func (a *ApiInfo) GetDescription() string

func (*ApiInfo) GetField added in v1.4.0

func (a *ApiInfo) GetField() reflect.StructField

func (*ApiInfo) GetHttpMethod added in v1.3.7

func (a *ApiInfo) GetHttpMethod() string

func (*ApiInfo) GetMeta added in v1.4.0

func (a *ApiInfo) GetMeta(tag string) string

func (*ApiInfo) GetMethodName added in v1.4.0

func (a *ApiInfo) GetMethodName() string

func (*ApiInfo) GetParams added in v1.3.7

func (a *ApiInfo) GetParams() []web.Param

func (*ApiInfo) GetURL added in v1.3.7

func (a *ApiInfo) GetURL() string

type Endpoint added in v1.3.7

type Endpoint struct {
	web.ApiInfo
	web.ServiceMethod
}

func (*Endpoint) GetApiInfo added in v1.3.7

func (e *Endpoint) GetApiInfo() web.ApiInfo

func (*Endpoint) GetServiceMethod added in v1.3.7

func (e *Endpoint) GetServiceMethod() web.ServiceMethod

func (*Endpoint) Handler added in v1.3.7

func (e *Endpoint) Handler(adapter web.ParamAdapter, handler func(result interface{}) error)

type Param

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

func (*Param) GetName added in v1.3.7

func (p *Param) GetName() string

func (*Param) GetSource added in v1.3.7

func (p *Param) GetSource() string

func (*Param) GetSpecifyType added in v1.4.0

func (p *Param) GetSpecifyType() string

func (*Param) GetType added in v1.3.7

func (p *Param) GetType() reflect.Type

func (*Param) SetType added in v1.3.7

func (p *Param) SetType(t reflect.Type)

type ParamMapper added in v1.4.1

type ParamMapper interface {
	GetStringFromPath(name string) (string, error)
	GetStringFromQuery(name string) (string, error)
	GetStringFromHeader(name string) (string, error)
	BindData(param web.Param) (interface{}, error)
	GetStringFromForm(name string) (string, error)
	GetMapFromForm() (map[string][]string, error)
	GetMultipartHeader(name string) (*multipart.FileHeader, error)
	GetMultipartFile(name string) (multipart.File, error)
	GetDataFromMultipart(name string) ([]byte, error)
	GetRequest() *http.Request
	GetResponseWriter() http.ResponseWriter
	GetContext() context.Context
}

type ServiceMethod added in v1.3.7

type ServiceMethod struct {
	Method *reflect.Method
	Value  *reflect.Value
}

func NewServiceMethod added in v1.3.7

func NewServiceMethod(method *reflect.Method, value *reflect.Value) *ServiceMethod

func (*ServiceMethod) GetMethod added in v1.3.7

func (s *ServiceMethod) GetMethod() *reflect.Method

func (*ServiceMethod) GetValue added in v1.3.7

func (s *ServiceMethod) GetValue() *reflect.Value

Jump to

Keyboard shortcuts

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