controllers

package
v0.0.0-...-3faa710 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package controllers controller User: 姜伟 Time: 2020-02-25 11:01:30

Package controllers router User: 姜伟 Time: 2020-02-25 11:00:22

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *routerBasic

NewRouter 实例化路由

Types

type ControllerBasic

type ControllerBasic struct {
	Validators         map[string]*mpvalidator.Filters // 校验器,key为动作标识,例: ActionGetName对应的标识为get-name,value为json字符串列表
	MwControllerPrefix []context.Handler               // 控制器前置中间件
	MwControllerSuffix []context.Handler               // 控制器后置中间件
	MwActionPrefix     map[string][]context.Handler    // 动作前置中间件
	MwActionSuffix     map[string][]context.Handler    // 动作后置中间件
}

ControllerBasic 控制器基础结构体

func NewControllerBasic

func NewControllerBasic() ControllerBasic

NewControllerBasic 实例化控制器基础结构体

func (*ControllerBasic) GetMwAction

func (c *ControllerBasic) GetMwAction(isPrefix bool, tag string) []context.Handler

GetMwAction 获取动作中间件

func (*ControllerBasic) GetMwController

func (c *ControllerBasic) GetMwController(isPrefix bool) []context.Handler

GetMwController 获取控制器中间件

func (*ControllerBasic) GetValidators

func (c *ControllerBasic) GetValidators() map[string]*mpvalidator.Filters

GetValidators 获取校验器列表

type IControllerBasic

type IControllerBasic interface {
	GetValidators() map[string]*mpvalidator.Filters          // 获取校验器列表
	GetMwController(isPrefix bool) []context.Handler         // 获取动作的中间件
	GetMwAction(isPrefix bool, tag string) []context.Handler // 获取动作的中间件
}

IControllerBasic 基础控制器接口

type IRouterBasic

type IRouterBasic interface {
	GetControllers() map[int]IControllerBasic
}

IRouterBasic 基础路由接口

Directories

Path Synopsis
Package backend common User: 姜伟 Time: 2020-02-25 11:07:41 Package backend index User: 姜伟 Time: 2020-02-25 11:07:58 Package backend router User: 姜伟 Time: 2020-02-25 11:08:14
Package backend common User: 姜伟 Time: 2020-02-25 11:07:41 Package backend index User: 姜伟 Time: 2020-02-25 11:07:58 Package backend router User: 姜伟 Time: 2020-02-25 11:08:14
Package frontend common User: 姜伟 Time: 2020-02-25 11:10:11 Package frontend index User: 姜伟 Time: 2020-02-25 11:10:59 Package frontend router User: 姜伟 Time: 2020-02-25 11:11:18
Package frontend common User: 姜伟 Time: 2020-02-25 11:10:11 Package frontend index User: 姜伟 Time: 2020-02-25 11:10:59 Package frontend router User: 姜伟 Time: 2020-02-25 11:11:18
Package index common User: 姜伟 Time: 2020-02-25 11:09:02 Package index index User: 姜伟 Time: 2020-02-25 11:09:20 Package index router User: 姜伟 Time: 2020-02-25 11:09:33
Package index common User: 姜伟 Time: 2020-02-25 11:09:02 Package index index User: 姜伟 Time: 2020-02-25 11:09:20 Package index router User: 姜伟 Time: 2020-02-25 11:09:33

Jump to

Keyboard shortcuts

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