mvc

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2017 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the `License`); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an `AS IS` BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	NO_PERM = -2 //无权限
	NO_AUTH = -1 //未登录
	FAILURE = 0  //操作失败
	SUCCESS = 1  //操作成功
)

Variables

View Source
var (
	//SnakeCase 单词全部小写并用下划线连接
	SnakeCase URLConvert = com.SnakeCase

	//LowerCaseFirst 小写首字母
	LowerCaseFirst URLConvert = com.LowerCaseFirst

	//PascalCase 帕斯卡命名法
	PascalCase URLRecovery = com.PascalCase

	//UpperCaseFirst 大写首字母
	UpperCaseFirst URLRecovery = strings.Title
)
View Source
var (
	ErrAppHasBeenDisabled     = errors.New(`This module has been disabled`)
	ErrAppHasNotBeenInstalled = errors.New(`This module has not been installed`)
	ErrAppHasExpired          = errors.New(`This module has expired`)
)
View Source
var (
	DefaultMapperCheck = func(t reflect.Type) bool {
		return t == mapperType
	}
	DefaultContextInitial = func(ctx echo.Context, wrp *Wrapper, controller interface{}, actionName string) (err error, exit bool) {
		return
	}
)

Functions

func HandlerWrapper added in v1.1.1

func HandlerWrapper(h interface{}) echo.Handler

Types

type After

type After interface {
	After() error
}

After 动态实例中的后置行为

type AfterHandler

type AfterHandler interface {
	After(echo.Context) error
}

AfterHandler 静态实例中的后置行为

type AllowFormat

type AllowFormat interface {
	AllowFormat(urlPath string, extension string) bool
}

type Application added in v1.1.1

type Application struct {
	Core               *echo.Echo
	Name               string
	TemplateDir        string
	StaticDir          string
	StaticRes          *resource.Static
	RouteTagName       string
	URLConvert         URLConvert  `json:"-" xml:"-"`
	URLRecovery        URLRecovery `json:"-" xml:"-"`
	MaxUploadSize      int64
	RootModuleName     string
	URL                string
	URLs               *URLs
	DefaultMiddlewares []interface{} `json:"-" xml:"-"`
	SessionOptions     *echo.SessionOptions
	Renderer           driver.Driver                                                   `json:"-" xml:"-"`
	FuncMap            map[string]interface{}                                          `json:"-" xml:"-"`
	ContextCreator     func(*echo.Echo) echo.Context                                   `json:"-" xml:"-"`
	ContextInitial     func(echo.Context, *Wrapper, interface{}, string) (error, bool) `json:"-" xml:"-"`
	Codec              codec.Codec                                                     `json:"-" xml:"-"`
	MapperCheck        func(t reflect.Type) bool                                       `json:"-" xml:"-"`
	// contains filtered or unexported fields
}

func App added in v1.1.1

func App(name string) *Application

func New

func New(name string, middlewares ...interface{}) (s *Application)

New 创建Application实例

func NewWithContext

func NewWithContext(name string, newContext func(*echo.Echo) echo.Context, middlewares ...interface{}) (s *Application)

NewWithContext 创建Application实例

func (*Application) AddEvent added in v1.1.1

func (s *Application) AddEvent(eventName string, handler interface{}) *Application

func (*Application) Debug added in v1.1.1

func (s *Application) Debug(on bool) *Application

Debug 开关debug模式

func (*Application) DefaultFuncMap added in v1.1.1

func (s *Application) DefaultFuncMap() (r map[string]interface{})

func (*Application) DelEvent added in v1.1.1

func (s *Application) DelEvent(eventName string) *Application

func (*Application) Event added in v1.1.1

func (s *Application) Event(eventName string, next func(bool), sessions ...interface{}) *Application

func (*Application) GoEvent added in v1.1.1

func (s *Application) GoEvent(eventName string, next func(bool), sessions ...interface{}) *Application

func (*Application) HasModule added in v1.1.1

func (s *Application) HasModule(name string) bool

func (*Application) InitCodec added in v1.1.1

func (s *Application) InitCodec(hashKey []byte, blockKey []byte)

InitCodec 初始化 加密/解密 接口

func (*Application) InitStatic added in v1.1.1

func (s *Application) InitStatic() *Application

InitStatic 初始化静态资源

func (*Application) LoadConfig added in v1.1.1

func (s *Application) LoadConfig(file string, config interface{}) error

LoadConfig 载入confl支持的配置文件

func (*Application) Module added in v1.1.1

func (s *Application) Module(args ...string) *Module

Module 获取模块实例

func (*Application) ModuleOk added in v1.1.1

func (s *Application) ModuleOk(args ...string) (app *Module, ok bool)

ModuleOk 获取模块实例

func (*Application) Modules added in v1.1.1

func (s *Application) Modules(args ...bool) map[string]*Module

func (*Application) NewModule added in v1.1.1

func (s *Application) NewModule(name string, middlewares ...interface{}) *Module

NewModule 创建新模块

func (*Application) NewRenderer added in v1.1.1

func (s *Application) NewRenderer(conf *render.Config, a *Module, funcMap map[string]interface{}) driver.Driver

NewRenderer 为特殊module(比如admin)单独新建渲染接口

func (*Application) NewStatic added in v1.1.1

func (s *Application) NewStatic(urlPath string, absPath string, f ...map[string]interface{}) *resource.Static

NewStatic 新建静态资源实例

func (*Application) NewTemplateEngine added in v1.1.1

func (s *Application) NewTemplateEngine(tmplPath string, conf *render.Config) driver.Driver

NewTemplateEngine 新建模板引擎实例

func (*Application) Pprof added in v1.1.1

func (s *Application) Pprof() *Application

Pprof 启用pprof

func (*Application) RootDir added in v1.1.1

func (s *Application) RootDir() string

RootDir 网站根目录

func (*Application) Run added in v1.1.1

func (s *Application) Run(args ...interface{})

Run 运行服务

func (*Application) ServeHTTP added in v1.1.1

func (s *Application) ServeHTTP(r engine.Request, w engine.Response)

ServeHTTP HTTP服务执行入口

func (*Application) SetDomain added in v1.1.1

func (s *Application) SetDomain(name string, domain string) *Application

SetDomain 为模块设置域名

func (*Application) SetErrorPages added in v1.1.1

func (s *Application) SetErrorPages(templates map[int]string, options ...*render.Options) *Application

func (*Application) SetSessionOptions added in v1.1.1

func (s *Application) SetSessionOptions(sessionOptions *echo.SessionOptions) *Application

func (*Application) SetTheme added in v1.1.1

func (s *Application) SetTheme(conf *render.Config) *Application

SetTheme 设置模板主题

func (*Application) TemplateMonitor added in v1.1.1

func (s *Application) TemplateMonitor() *Application

TemplateMonitor 模板监控事件

func (*Application) Theme added in v1.1.1

func (s *Application) Theme() string

Theme 当前使用的主题名称

func (*Application) ThemeDir added in v1.1.1

func (s *Application) ThemeDir(args ...string) string

ThemeDir 主题所在文件夹的路径

func (*Application) Tree added in v1.1.1

func (s *Application) Tree(args ...*echo.Echo) (r map[string]map[string]map[string]map[string]string)

Tree module -> controller -> action -> HTTP-METHODS

type Before

type Before interface {
	Before() error
}

Before 动态实例中的前置行为

type BeforeHandler

type BeforeHandler interface {
	Before(echo.Context) error
}

BeforeHandler 静态实例中的前置行为

type Context added in v1.1.1

type Context struct {
	echo.Context
	Application    *Application
	Module         *Module
	C              interface{}
	ControllerName string
	ActionName     string
	Tmpl           string
	Output         Data
	// contains filtered or unexported fields
}

func NewContext added in v1.1.1

func NewContext(a *Application, c echo.Context) *Context

func (*Context) A added in v1.1.1

func (c *Context) A(ctl string, act string) (err error)

A 调用控制器方法

func (*Context) Assign added in v1.1.1

func (c *Context) Assign(key string, val interface{}) *Context

func (*Context) Assignx added in v1.1.1

func (c *Context) Assignx(values *map[string]interface{}) *Context

func (*Context) Atoe added in v1.1.1

func (c *Context) Atoe(v string) error

Atoe 字符串转error

func (*Context) Body added in v1.1.1

func (c *Context) Body() ([]byte, error)

func (*Context) BuildURL added in v1.1.1

func (c *Context) BuildURL(ctl string, act string, args ...interface{}) string

BuildURL 生成当前Module网址

func (*Context) CheckTmplPath added in v1.1.1

func (c *Context) CheckTmplPath(tpath string) string

func (*Context) Display added in v1.1.1

func (c *Context) Display(args ...interface{}) error

func (*Context) ErrorWithCode added in v1.1.1

func (c *Context) ErrorWithCode(code int, args ...string) *echo.HTTPError

ErrorWithCode 生成HTTPError

func (*Context) Exit added in v1.1.1

func (c *Context) Exit(args ...bool) *Context

func (*Context) GenNextURL added in v1.1.1

func (c *Context) GenNextURL(u string) string

GenNextURL 生成安全编码后的下一步网址

func (*Context) GetNextURL added in v1.1.1

func (c *Context) GetNextURL() string

GetNextURL 自动获取下一步网址

func (*Context) GetSecCookie added in v1.1.1

func (c *Context) GetSecCookie(key string) (value string)

func (*Context) Goto added in v1.1.1

func (c *Context) Goto(goURL string, args ...interface{}) error

Goto 页面跳转(根据路由生成网址后跳转)

func (*Context) GotoNext added in v1.1.1

func (c *Context) GotoNext(defaultURL ...string) error

GotoNext 跳转到下一步

func (*Context) IP added in v1.1.1

func (c *Context) IP() string

func (*Context) Init added in v1.1.1

func (c *Context) Init(wrp *Wrapper, controller interface{}, actName string) (error, bool)

func (*Context) IsExit added in v1.1.1

func (c *Context) IsExit() bool

func (*Context) ModuleURL added in v1.1.1

func (c *Context) ModuleURL(mod string, ctl string, act string, args ...interface{}) string

ModuleURL 生成指定Module网址

func (*Context) ModuleURLFor added in v1.1.1

func (c *Context) ModuleURLFor(ppath string, args ...map[string]interface{}) string

ModuleURLFor 生成指定Module网址

func (*Context) NextURL added in v1.1.1

func (c *Context) NextURL(defaultURL ...string) string

NextURL 获取下一步网址

func (*Context) OnlyAjax added in v1.1.1

func (c *Context) OnlyAjax() bool

func (*Context) ParseNextURL added in v1.1.1

func (c *Context) ParseNextURL(next string) string

ParseNextURL 解析下一步网址

func (*Context) PjaxContainer added in v1.1.1

func (c *Context) PjaxContainer() string

func (*Context) Redir added in v1.1.1

func (c *Context) Redir(url string, args ...interface{}) error

Redir 页面跳转

func (*Context) Refer added in v1.1.1

func (c *Context) Refer() string

Refer returns http referer header.

func (*Context) Reset added in v1.1.1

func (c *Context) Reset(req engine.Request, resp engine.Response)

func (*Context) SecCookie added in v1.1.1

func (c *Context) SecCookie(key string, value interface{})

func (*Context) SetErr added in v1.1.1

func (c *Context) SetErr(args ...interface{}) *Context

SetErr 设置出错类型为“操作失败”(info,zone,data)

func (*Context) SetNoAuth added in v1.1.1

func (c *Context) SetNoAuth(args ...interface{}) *Context

SetNoAuth 设置出错类型为“未登录”(info,zone,data)

func (*Context) SetNoPerm added in v1.1.1

func (c *Context) SetNoPerm(args ...interface{}) *Context

SetNoPerm 设置出错类型为“未授权”(message,for,data)

func (*Context) SetOutput added in v1.1.1

func (c *Context) SetOutput(code int, args ...interface{}) *Context

SetOutput 设置输出(code,info,zone,data)

func (*Context) SetSecCookie added in v1.1.1

func (c *Context) SetSecCookie(key string, value interface{})

func (*Context) SetSuc added in v1.1.1

func (c *Context) SetSuc(args ...interface{}) *Context

SetSuc 设置响应类型为“操作成功”(info,zone,data)

func (*Context) SetSucData added in v1.1.1

func (c *Context) SetSucData(data interface{}) *Context

SetSucData 设置成功返回的数据

func (*Context) SetTmpl added in v1.1.1

func (c *Context) SetTmpl(args ...string) *Context

SetTmpl 指定要渲染的模板路径

func (*Context) SubDomain added in v1.1.1

func (c *Context) SubDomain() string

SubDomain returns sub domain string. if aa.bb.domain.com, returns aa.bb .

func (*Context) TmplPath added in v1.1.1

func (c *Context) TmplPath(args ...string) string

TmplPath 生成模板路径 args: ActionName,ControllerName,ModuleName

func (*Context) U added in v1.1.1

func (c *Context) U(args ...string) (s string)

U 网址生成

func (*Context) URLFor added in v1.1.1

func (c *Context) URLFor(ppath string, args ...map[string]interface{}) string

URLFor 生成当前Module网址

type ContextInitial added in v1.1.1

type ContextInitial interface {
	Init(*Wrapper, interface{}, string) (error, bool)
}

type Controller added in v1.1.1

type Controller struct {
	*Context
	logger.Logger
}

func NewController added in v1.1.1

func NewController(c echo.Context) *Controller

func (*Controller) Init added in v1.1.1

func (a *Controller) Init(c echo.Context) error

type Data added in v1.1.1

type Data interface {
	Assign(key string, val interface{})
	Assignx(values *map[string]interface{})
	SetTmplFuncs()
	Render(tmpl string, code ...int) error
	String() string
	Set(code int, args ...interface{})
	Gets() (code echo.State, info interface{}, zone interface{}, data interface{})
	GetData() interface{}
}

type ExitChecker

type ExitChecker interface {
	IsExit() bool
}

type Handler

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

func NewHandler

func NewHandler(h func(echo.Context) error, name string) *Handler

func (*Handler) Handle

func (h *Handler) Handle(c echo.Context) error

func (*Handler) HandleName

func (h *Handler) HandleName() string

type Initer

type Initer interface {
	Init(echo.Context) error
}

Initer 动态实例中的初始化行为

type IniterFunc added in v1.1.1

type IniterFunc func(interface{}) error

type Main

type Main interface {
	Main() error
}

Main 动态实例中的行为入口

type Mapper

type Mapper struct{}

Mapper 结构体中定义路由的字段类型

type Module

type Module struct {
	*Application `json:"-" xml:"-"`
	Group        *echo.Group   `json:"-" xml:"-"`
	Handler      *echo.Echo    `json:"-" xml:"-"` //指定域名时有效
	Middlewares  []interface{} `json:"-" xml:"-"`
	Renderer     driver.Driver `json:"-" xml:"-"`
	Name         string
	Domain       string

	URL string
	Dir string

	// 模块附加信息
	Disabled    int    // 禁用时间戳,为0时为启用状态
	Installed   int    // 安装时间戳,为0时为未安装
	Expired     int    // 过期时间戳,为0时为永不过期
	Author      string // 作者名称
	Website     string // 作者网址
	Email       string // 作者邮箱
	Description string // 简介
	Config      ModuleConfiger

	// 安装和卸载逻辑
	Install   func() error `json:"-" xml:"-"`
	Uninstall func() error `json:"-" xml:"-"`
	// contains filtered or unexported fields
}

func NewModule

func NewModule(name string, domain string, s *Application, middlewares ...interface{}) (a *Module)

func (*Module) AddHandler

func (a *Module) AddHandler(c interface{}) *Wrapper

AddHandler 登记控制器

func (*Module) C

func (a *Module) C(name string) (c interface{})

C 获取控制器

func (*Module) ClearCachedHandlerNames

func (a *Module) ClearCachedHandlerNames()

func (*Module) ExecAction

func (a *Module) ExecAction(action string, t reflect.Type, v reflect.Value, c echo.Context) (err error)

ExecAction 执行Action的通用方式

func (*Module) InitRenderer

func (a *Module) InitRenderer(conf *render.Config, funcMap map[string]interface{}) *Module

InitRenderer 初始化渲染接口(用于单独对app指定renderer,如不指定,默认会使用Server中Renderer)

func (*Module) Register

func (a *Module) Register(p string, v interface{}, methods ...string) *Module

Register 注册路由:module.Register(`/index`,Index.Index,"GET","POST")

func (*Module) Router

func (a *Module) Router() echo.ICore

func (*Module) SafelyCall

func (a *Module) SafelyCall(fn reflect.Value, args []reflect.Value) (resp []reflect.Value, err error)

SafelyCall invokes `function` in recover block

func (*Module) Use

func (a *Module) Use(args ...interface{}) *Module

Use 批量注册控制器路由

func (*Module) Valid

func (a *Module) Valid() error

func (*Module) Wrapper

func (a *Module) Wrapper(name string) (wp *Wrapper)

Wrapper 获取封装器

type ModuleConfig

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

func (*ModuleConfig) Config

func (a *ModuleConfig) Config() interface{}

func (*ModuleConfig) Get

func (a *ModuleConfig) Get(recvFn func(interface{}))

Get usage: var appConf *map[string]string

a.Get(func(conf interface{}){
	if v, y := conf.(*map[string]string); y {
		appConf = v
	}
})

func (*ModuleConfig) Init

func (a *ModuleConfig) Init(config interface{}) ModuleConfiger

func (*ModuleConfig) IsValid

func (a *ModuleConfig) IsValid() bool

func (*ModuleConfig) Set

func (a *ModuleConfig) Set(data string) error

Set usage: var appConf map[string]string a.Set(`{"Name":"webx"}`)

func (*ModuleConfig) SetTemplate

func (a *ModuleConfig) SetTemplate(tmplFile string) ModuleConfiger

func (*ModuleConfig) String

func (a *ModuleConfig) String() string

func (*ModuleConfig) Template

func (a *ModuleConfig) Template() string

type ModuleConfiger

type ModuleConfiger interface {
	Init(conf interface{}) ModuleConfiger
	Set(data string) error
	Get(recvFn func(interface{}))
	Config() interface{}
	IsValid() bool
	String() string
	Template() string                           //获取表单模板名称
	SetTemplate(tmplFile string) ModuleConfiger //获取设置表单模板
}

type StaticIniter

type StaticIniter interface {
	Init(wrp *Wrapper, act string) error
}

type URLConvert

type URLConvert func(string) string

URLConvert 网址转换

type URLRecovery

type URLRecovery func(string) string

URLRecovery 网址还原

type URLs

type URLs struct {
	*Application `json:"-" xml:"-"`
	// contains filtered or unexported fields
}

func NewURLs

func NewURLs(project string, mvc *Application) *URLs

func (*URLs) AllowFormat

func (a *URLs) AllowFormat(key string, ext string) (ok bool)

func (*URLs) Build

func (a *URLs) Build(mdl string, ctl string, act string, params ...interface{}) (r string)

func (*URLs) BuildFromPath

func (a *URLs) BuildFromPath(ppath string, args ...map[string]interface{}) (r string)

func (*URLs) Set

func (a *URLs) Set(h interface{}) (pkg string, ctl string, act string)

func (*URLs) SetExtensions

func (a *URLs) SetExtensions(key string, exts []string) *URLs

func (*URLs) SetProjectPath

func (a *URLs) SetProjectPath(projectPath string)

type Wrapper

type Wrapper struct {

	// 实例对象
	Controller     interface{}        `json:"-" xml:"-"`
	RouteRegister  echo.RouteRegister `json:"-" xml:"-"`
	Module         *Module            `json:"-" xml:"-"`
	ControllerName string
	// contains filtered or unexported fields
}

func (*Wrapper) Auto

func (a *Wrapper) Auto(args ...interface{})

Auto 自动注册动态实例的路由:a.Auto()

func (*Wrapper) Exec

func (a *Wrapper) Exec(ctx echo.Context, t reflect.Type, action string) error

func (*Wrapper) HandleName

func (a *Wrapper) HandleName(h interface{}) string

func (*Wrapper) Register

func (a *Wrapper) Register(p string, h interface{}, methods ...string) *Wrapper

Register 路由注册方案1:注册函数(可匿名)或静态实例的成员函数 例如:Register(`/index`,Index.Index,"GET","POST")

func (*Wrapper) RouteMethods

func (a *Wrapper) RouteMethods()

RouteMethods 路由注册方案3:自动注册动态实例内带HTTP方法名后缀的成员函数作为路由

func (*Wrapper) RouteTags

func (a *Wrapper) RouteTags()

RouteTags 路由注册方案2:从动态实例内Mapper类型字段标签中获取路由信息

Directories

Path Synopsis
static
minify
Package cssmin minifies CSS.
Package cssmin minifies CSS.

Jump to

Keyboard shortcuts

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