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.
Index ¶
- Constants
- Variables
- func HandlerWrapper(h interface{}) echo.Handler
- type After
- type AfterHandler
- type AllowFormat
- type Application
- func (s *Application) AddEvent(eventName string, handler interface{}) *Application
- func (s *Application) Commit()
- func (s *Application) Debug(on bool) *Application
- func (s *Application) DefaultFuncMap() (r map[string]interface{})
- func (s *Application) DelEvent(eventName string) *Application
- func (s *Application) Event(eventName string, next func(bool), sessions ...interface{}) *Application
- func (s *Application) FindModuleByDomain(host string) (*Module, bool)
- func (s *Application) FuncMapCopyTo(m map[string]interface{}) *Application
- func (s *Application) GoEvent(eventName string, next func(bool), sessions ...interface{}) *Application
- func (s *Application) HasModule(name string) bool
- func (s *Application) InitCodec(hashKey []byte, blockKey []byte)
- func (s *Application) InitStatic() *Application
- func (s *Application) LoadConfig(file string, config interface{}) error
- func (s *Application) Module(args ...string) *Module
- func (s *Application) ModuleOk(args ...string) (app *Module, ok bool)
- func (s *Application) Modules(args ...bool) map[string]*Module
- func (s *Application) NewModule(name string, middlewares ...interface{}) *Module
- func (s *Application) NewRenderer(conf *render.Config, a *Module, funcMap map[string]interface{}) (driver.Driver, *resource.Static)
- func (s *Application) NewStatic(urlPath string, absPath string, f ...map[string]interface{}) *resource.Static
- func (s *Application) NewTemplateEngine(tmplPath string, conf *render.Config) driver.Driver
- func (s *Application) Pprof() *Application
- func (s *Application) Pre(middleware ...interface{})
- func (s *Application) RootDir() string
- func (s *Application) Run(args ...interface{})
- func (s *Application) ServeHTTP(r engine.Request, w engine.Response)
- func (s *Application) SetDomain(name string, domain string) *Application
- func (s *Application) SetHTTPErrorOptions(options *render.Options) *Application
- func (s *Application) SetSessionOptions(sessionOptions *echo.SessionOptions) *Application
- func (s *Application) SetTheme(conf *render.Config) *Application
- func (s *Application) TemplateMonitor() *Application
- func (s *Application) Theme() string
- func (s *Application) ThemeDir(args ...string) string
- func (s *Application) Tree(args ...*echo.Echo) (r map[string]map[string]map[string]map[string]string)
- func (s *Application) Use(middleware ...interface{})
- type Before
- type BeforeHandler
- type Context
- func (c *Context) Action(ctl string, act string) (err error)
- func (c *Context) Assign(key string, val interface{}) *Context
- func (c *Context) Assignx(values *map[string]interface{}) *Context
- func (c *Context) Atoe(v string) error
- func (c *Context) Body() ([]byte, error)
- func (c *Context) BuildURL(ctl string, act string, args ...interface{}) string
- func (c *Context) CheckPath() string
- func (c *Context) CheckTmplPath(tpath string) string
- func (c *Context) Display(args ...interface{}) error
- func (c *Context) ErrorWithCode(code int, args ...string) *echo.HTTPError
- func (c *Context) Exit(args ...bool) *Context
- func (c *Context) GenNextURL(u string) string
- func (c *Context) GetNextURL(allowReferer ...bool) string
- func (c *Context) GetSecCookie(key string) (value string)
- func (c *Context) Go(url string, args ...interface{}) error
- func (c *Context) Goto(goURL string, args ...interface{}) error
- func (c *Context) GotoNext(defaultURL ...string) error
- func (c *Context) IP() string
- func (c *Context) Init(wrp *Wrapper, controller interface{}, actName string) (error, bool)
- func (c *Context) IsExit() bool
- func (c *Context) ModuleAction(mod string, ctl string, act string) (err error)
- func (c *Context) ModuleURL(mod string, ctl string, act string, args ...interface{}) string
- func (c *Context) ModuleURLPath(ppath string, args ...map[string]interface{}) string
- func (c *Context) NextURL(defaultURL ...string) string
- func (c *Context) OnlyAjax() bool
- func (c *Context) ParseNextURL(next string) string
- func (c *Context) PjaxContainer() string
- func (c *Context) Refer() string
- func (c *Context) Reset(req engine.Request, resp engine.Response)
- func (c *Context) RootModuleURL(ctl string, act string, args ...interface{}) string
- func (c *Context) SecCookie(key string, value interface{})
- func (c *Context) SetErr(args ...interface{}) *Context
- func (c *Context) SetNoAuth(args ...interface{}) *Context
- func (c *Context) SetNoPerm(args ...interface{}) *Context
- func (c *Context) SetOutput(code int, args ...interface{}) *Context
- func (c *Context) SetSecCookie(key string, value interface{})
- func (c *Context) SetSuc(args ...interface{}) *Context
- func (c *Context) SetSucData(data interface{}) *Context
- func (c *Context) SetTmpl(args ...string) *Context
- func (c *Context) SubDomain() string
- func (c *Context) TmplPath(args ...string) string
- func (c *Context) U(args ...string) (s string)
- func (c *Context) URLFor(mod string, ctl string, act string, args ...interface{}) string
- func (c *Context) URLPath(ppath string, args ...map[string]interface{}) string
- type ContextInitial
- type Controller
- type ExitChecker
- type Handler
- type Initer
- type IniterFunc
- type Main
- type Mapper
- type Module
- func (a *Module) Add(args ...interface{}) *Module
- func (a *Module) AddHandler(c interface{}) *Wrapper
- func (a *Module) C(name string) (c interface{})
- func (a *Module) ClearCachedHandlerNames()
- func (a *Module) Commit()
- func (a *Module) ExecAction(action string, t reflect.Type, v reflect.Value, c echo.Context) (err error)
- func (a *Module) InitRenderer(conf *render.Config, funcMap map[string]interface{}) *Module
- func (a *Module) Pre(middleware ...interface{})
- func (a *Module) Register(p string, v interface{}, methods ...string) *Module
- func (a *Module) Router() echo.ICore
- func (a *Module) SafelyCall(fn reflect.Value, args []reflect.Value) (resp []reflect.Value, err error)
- func (a *Module) Use(middleware ...interface{})
- func (a *Module) Valid() error
- func (a *Module) Wrapper(name string) (wp *Wrapper)
- type ModuleConfig
- func (a *ModuleConfig) Config() interface{}
- func (a *ModuleConfig) Get(recvFn func(interface{}))
- func (a *ModuleConfig) Init(config interface{}) ModuleConfiger
- func (a *ModuleConfig) IsValid() bool
- func (a *ModuleConfig) Set(data string) error
- func (a *ModuleConfig) SetTemplate(tmplFile string) ModuleConfiger
- func (a *ModuleConfig) String() string
- func (a *ModuleConfig) Template() string
- type ModuleConfiger
- type Resource
- type StaticIniter
- type URLBuilder
- func (a *URLBuilder) AllowFormat(key string, ext string) (ok bool)
- func (a *URLBuilder) Build(mdl string, ctl string, act string, params ...interface{}) (r string)
- func (a *URLBuilder) BuildFromPath(ppath string, args ...map[string]interface{}) (r string)
- func (a *URLBuilder) Set(h interface{}) (pkg string, ctl string, act string)
- func (a *URLBuilder) SetExtensions(key string, exts []string) *URLBuilder
- func (a *URLBuilder) SetProjectPath(projectPath string)
- type URLConvert
- type URLRecovery
- type Wrapper
- func (a *Wrapper) Auto(args ...interface{})
- func (a *Wrapper) Exec(ctx echo.Context, t reflect.Type, action string) error
- func (a *Wrapper) Name(h interface{}) string
- func (a *Wrapper) Register(p string, h interface{}, methods ...string) *Wrapper
- func (a *Wrapper) RouteMethods()
- func (a *Wrapper) RouteTags()
Constants ¶
const ( NO_PERM = -2 //无权限 NO_AUTH = -1 //未登录 FAILURE = 0 //操作失败 SUCCESS = 1 //操作成功 )
Variables ¶
var ( //SnakeCase 单词全部小写并用下划线连接 SnakeCase URLConvert = com.SnakeCase //LowerCaseFirst 小写首字母 LowerCaseFirst URLConvert = com.LowerCaseFirst //PascalCase 帕斯卡命名法 PascalCase URLRecovery = com.PascalCase //UpperCaseFirst 大写首字母 UpperCaseFirst URLRecovery = strings.Title )
Functions ¶
func HandlerWrapper ¶ added in v1.1.1
HandlerWrapper 增加对"func(*Context) error"的支持
Types ¶
type AfterHandler ¶
AfterHandler 静态实例中的后置行为
type AllowFormat ¶
type Application ¶ added in v1.1.1
type Application struct { Core *echo.Echo Name string TemplateDir string Resource *Resource RouteTagName string URLConvert URLConvert `json:"-" xml:"-"` URLRecovery URLRecovery `json:"-" xml:"-"` MaxUploadSize int64 RootModuleName string URL string URLBuilder *URLBuilder DefaultMiddlewares []interface{} `json:"-" xml:"-"` DefaultPreMiddlewares []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 }
Application 定义应用
func App ¶ added in v1.1.1
func App(name string) *Application
func NewWithContext ¶
NewWithContext 创建Application实例
func (*Application) AddEvent ¶ added in v1.1.1
func (s *Application) AddEvent(eventName string, handler interface{}) *Application
AddEvent 添加事件
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{})
DefaultFuncMap 模板的默认函数
func (*Application) DelEvent ¶ added in v1.1.1
func (s *Application) DelEvent(eventName string) *Application
DelEvent 删除事件
func (*Application) Event ¶ added in v1.1.1
func (s *Application) Event(eventName string, next func(bool), sessions ...interface{}) *Application
Event 执行事件
func (*Application) FindModuleByDomain ¶ added in v1.3.5
func (s *Application) FindModuleByDomain(host string) (*Module, bool)
FindModuleByDomain 根据域名查询对应模块实例
func (*Application) FuncMapCopyTo ¶ added in v1.3.0
func (s *Application) FuncMapCopyTo(m map[string]interface{}) *Application
FuncMapCopyTo 获取模板的默认函数副本
func (*Application) GoEvent ¶ added in v1.1.1
func (s *Application) GoEvent(eventName string, next func(bool), sessions ...interface{}) *Application
GoEvent 并行执行事件
func (*Application) HasModule ¶ added in v1.1.1
func (s *Application) HasModule(name string) bool
HasModule 检查模块是否存在
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
Modules 获取模块列表,如果传递参数值为true,返回所有域名所对应的模块列表
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, *resource.Static)
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
NewTemplateEngine 新建模板引擎实例
func (*Application) Pprof ¶ added in v1.1.1
func (s *Application) Pprof() *Application
Pprof 启用pprof
func (*Application) Pre ¶ added in v1.3.0
func (s *Application) Pre(middleware ...interface{})
Pre 全局前置中间件
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) SetHTTPErrorOptions ¶ added in v1.3.9
func (s *Application) SetHTTPErrorOptions(options *render.Options) *Application
SetHTTPErrorOptions 设置错误处理选项
func (*Application) SetSessionOptions ¶ added in v1.1.1
func (s *Application) SetSessionOptions(sessionOptions *echo.SessionOptions) *Application
SetSessionOptions 设置Session配置
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) 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
func (*Application) Use ¶ added in v1.3.0
func (s *Application) Use(middleware ...interface{})
Use 全局中间件
type BeforeHandler ¶
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 // contains filtered or unexported fields }
func NewContext ¶ added in v1.1.1
func NewContext(a *Application, c echo.Context) *Context
func (*Context) CheckTmplPath ¶ added in v1.1.1
func (*Context) ErrorWithCode ¶ added in v1.1.1
ErrorWithCode 生成HTTPError
func (*Context) GenNextURL ¶ added in v1.1.1
GenNextURL 生成安全编码后的下一步网址
func (*Context) GetNextURL ¶ added in v1.1.1
GetNextURL 自动获取下一步网址
func (*Context) GetSecCookie ¶ added in v1.1.1
func (*Context) ModuleAction ¶ added in v1.3.5
ModuleAction 调用控制器方法
func (*Context) ModuleURLPath ¶ added in v1.3.0
ModuleURLPath 生成指定Module网址
func (*Context) ParseNextURL ¶ added in v1.1.1
ParseNextURL 解析下一步网址
func (*Context) PjaxContainer ¶ added in v1.1.1
func (*Context) RootModuleURL ¶ added in v1.3.0
RootModuleURL 生成根Module网址
func (*Context) SetSecCookie ¶ added in v1.1.1
func (*Context) SetSucData ¶ added in v1.1.1
SetSucData 设置成功返回的数据
func (*Context) SubDomain ¶ added in v1.1.1
SubDomain returns sub domain string. if aa.bb.domain.com, returns aa.bb .
func (*Context) TmplPath ¶ added in v1.1.1
TmplPath 生成模板路径 args: ActionName,ControllerName,ModuleName
func (*Context) U ¶ added in v1.1.1
U 网址生成 @usage: c.U(moduleName,controllerName,actionName) or c.U(moduleName,controllerName,actionName,`?q=coscms`) c.U(controllerName,actionName) or c.U(controllerName,actionName,`?q=coscms`) c.U(actionName) or or c.U(actionName,`?q=coscms`)
type ContextInitial ¶ added in v1.1.1
type Controller ¶ added in v1.1.1
func NewController ¶ added in v1.1.1
func NewController(c echo.Context) *Controller
type ExitChecker ¶
type ExitChecker interface {
IsExit() bool
}
type IniterFunc ¶ added in v1.1.1
type IniterFunc func(interface{}) error
type Module ¶
type Module struct { *Application `json:"-" xml:"-"` Group *echo.Group `json:"-" xml:"-"` Handler *echo.Echo `json:"-" xml:"-"` //指定域名时有效 PreMiddlewares []interface{} `json:"-" xml:"-"` Middlewares []interface{} `json:"-" xml:"-"` Renderer driver.Driver `json:"-" xml:"-"` Resource *resource.Static Name string Domain string URL string Dir string // 模块附加信息 Disabled int64 // 禁用时间戳,为0时为启用状态 Installed int64 // 安装时间戳,为0时为未安装 Expired int64 // 过期时间戳,为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) 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 ¶
InitRenderer 初始化渲染接口(用于单独对app指定renderer,如不指定,默认会使用Server中Renderer)
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 URLBuilder ¶ added in v1.3.5
type URLBuilder struct { *Application `json:"-" xml:"-"` // contains filtered or unexported fields }
func NewURLBuilder ¶ added in v1.3.5
func NewURLBuilder(project string, mvc *Application) *URLBuilder
func (*URLBuilder) AllowFormat ¶ added in v1.3.5
func (a *URLBuilder) AllowFormat(key string, ext string) (ok bool)
func (*URLBuilder) Build ¶ added in v1.3.5
func (a *URLBuilder) Build(mdl string, ctl string, act string, params ...interface{}) (r string)
func (*URLBuilder) BuildFromPath ¶ added in v1.3.5
func (a *URLBuilder) BuildFromPath(ppath string, args ...map[string]interface{}) (r string)
func (*URLBuilder) Set ¶ added in v1.3.5
func (a *URLBuilder) Set(h interface{}) (pkg string, ctl string, act string)
func (*URLBuilder) SetExtensions ¶ added in v1.3.5
func (a *URLBuilder) SetExtensions(key string, exts []string) *URLBuilder
func (*URLBuilder) SetProjectPath ¶ added in v1.3.5
func (a *URLBuilder) 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) Register ¶
Register 路由注册方案1:注册函数(可匿名)或静态实例的成员函数 例如:Register(`/index`,Index.Index,"GET","POST")
func (*Wrapper) RouteMethods ¶
func (a *Wrapper) RouteMethods()
RouteMethods 路由注册方案3:自动注册动态实例内带HTTP方法名后缀的成员函数作为路由