Controller

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(w http.ResponseWriter, err string)

func JSON

func JSON(w http.ResponseWriter, data interface{})

func Ok

func Ok(w http.ResponseWriter, data string)

func RequestParamTypeConvertFunc added in v1.4.7

func RequestParamTypeConvertFunc(index int, paramType reflect.Type, ctx *Context.HttpContext)

Types

type ActionExecutorContext added in v1.4.7

type ActionExecutorContext struct {
	ControllerName string
	ActionName     string

	Controller IController
	Context    *Context.HttpContext
	In         *ActionExecutorInParam
}

type ActionExecutorInParam added in v1.4.7

type ActionExecutorInParam struct {
	ActionParamTypes []reflect.Type
	MethodInovker    *Utils.MethodCaller
}

type ActionMethodExecutor added in v1.4.7

type ActionMethodExecutor struct {
}

func NewActionMethodExecutor added in v1.4.7

func NewActionMethodExecutor() ActionMethodExecutor

func (ActionMethodExecutor) Execute added in v1.4.7

func (actionExecutor ActionMethodExecutor) Execute(ctx *ActionExecutorContext) interface{}

type ApiController added in v1.4.0

type ApiController struct {
}

func (*ApiController) Fail added in v1.4.7

func (c *ApiController) Fail(msg string) ApiResult

func (*ApiController) GetName added in v1.4.7

func (c *ApiController) GetName() string

func (*ApiController) OK added in v1.4.7

func (c *ApiController) OK(data interface{}) ApiResult

type ApiResult

type ApiResult struct {
	Success bool
	Message string
	Data    interface{}
}

type ControllerBuilder added in v1.4.7

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

func NewControllerBuilder added in v1.4.7

func NewControllerBuilder(sc *DependencyInjection.ServiceCollection) *ControllerBuilder

func (*ControllerBuilder) AddController added in v1.4.7

func (builder *ControllerBuilder) AddController(controllerCtor interface{})

type IController added in v1.4.0

type IController interface {
	GetName() string
}

func ActivateController added in v1.4.7

func ActivateController(serviceProvider DependencyInjection.IServiceProvider, controllerName string) IController

type RequestBody added in v1.4.7

type RequestBody struct {
}

Jump to

Keyboard shortcuts

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