Documentation
¶
Overview ¶
Package module 模块的管理
Index ¶
- type Module
- func (m *Module) AddAt(title string, f app.JobFunc, spec string, delay bool)
- func (m *Module) AddCron(title string, f app.JobFunc, spec string, delay bool)
- func (m *Module) AddService(f app.ServiceFunc, title string)
- func (m *Module) AddTicker(title string, f app.JobFunc, dur time.Duration, delay bool)
- func (m *Module) Delete(path string, h http.Handler) *mux.Prefix
- func (m *Module) DeleteFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
- func (m *Module) Get(path string, h http.Handler) *mux.Prefix
- func (m *Module) GetFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
- func (m *Module) Handle(path string, h http.Handler, methods ...string) error
- func (m *Module) HandleFunc(path string, h func(w http.ResponseWriter, r *http.Request), methods ...string) error
- func (m *Module) NewTag(tag string) *Tag
- func (m *Module) Patch(path string, h http.Handler) *mux.Prefix
- func (m *Module) PatchFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
- func (m *Module) Plugin(name, description string, deps ...string)
- func (m *Module) Post(path string, h http.Handler) *mux.Prefix
- func (m *Module) PostFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
- func (m *Module) Prefix(prefix string) *mux.Prefix
- func (m *Module) Put(path string, h http.Handler) *mux.Prefix
- func (m *Module) PutFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
- type Modules
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
Tag
Name string
Description string
Deps []string
// contains filtered or unexported fields
}
Module 表示模块信息
func (*Module) AddAt ¶ added in v0.26.0
AddAt 添加新的定时任务
f 表示服务的运行函数; title 是对该服务的简要说明; spec 指定的时间点; delay 是否在任务执行完之后,才计算下一次的执行时间点。
func (*Module) AddCron ¶ added in v0.26.0
AddCron 添加新的定时任务
f 表示服务的运行函数; title 是对该服务的简要说明; spec cron 表达式,支持秒; delay 是否在任务执行完之后,才计算下一次的执行时间点。
func (*Module) AddService ¶ added in v0.25.0
func (m *Module) AddService(f app.ServiceFunc, title string)
AddService 添加新的服务
f 表示服务的运行函数; title 是对该服务的简要说明。
func (*Module) AddTicker ¶ added in v0.26.0
AddTicker 添加新的定时任务
f 表示服务的运行函数; title 是对该服务的简要说明; delay 是否在任务执行完之后,才计算下一次的执行时间点。
func (*Module) DeleteFunc ¶
func (m *Module) DeleteFunc(path string, h func(w http.ResponseWriter, r *http.Request)) *mux.Prefix
DeleteFunc 指定一个 Delete 请求
func (*Module) HandleFunc ¶
func (m *Module) HandleFunc(path string, h func(w http.ResponseWriter, r *http.Request), methods ...string) error
HandleFunc 指定一个请求
func (*Module) NewTag ¶ added in v0.16.1
NewTag 为当前模块生成特定名称的子模块。若已经存在,则直接返回该子模块。
Tag 是依赖关系与当前模块相同,但是功能完全独立的模块, 一般用于功能更新等操作。
type Modules ¶ added in v0.25.0
type Modules struct {
// contains filtered or unexported fields
}
Modules 模块管理
func NewModules ¶ added in v0.25.0
NewModules 声明新的 Modules 对象
Click to show internal directories.
Click to hide internal directories.