controller

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleFsApi added in v1.3.4

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

func HandleRestApi added in v1.3.4

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

func NewEndpoint added in v1.3.7

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

Types

type ApiInfo added in v1.3.7

type ApiInfo struct {
	HttpMethod  string
	URL         string
	Description string
	Params      []web.Param
}

func NewApiInfo added in v1.3.7

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

func (*ApiInfo) GetDescription added in v1.3.7

func (a *ApiInfo) GetDescription() string

func (*ApiInfo) GetHttpMethod added in v1.3.7

func (a *ApiInfo) GetHttpMethod() 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(mapper web.ParamMapper, handler func(result interface{}) error)

type Param

type Param struct {
	Name   string
	Source string
	Type   reflect.Type
}

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) 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 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