Documentation ¶
Index ¶
- Constants
- type Component
- func (c *Component) Crons() []ecron.Ecron
- func (c *Component) Name() string
- func (c *Component) PackageName() string
- func (c *Component) PluginStopFuncs() []func() error
- func (c *Component) Send(key string, req *SendRequest) (resp *SendResponse)
- func (c *Component) Start() error
- func (c *Component) Stop() error
- type Container
- type Option
- type ParentPlugin
- type SendRequest
- type SendResponse
- type SenderPlugin
Constants ¶
View Source
const PackageName = "component.emns"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component emns 组件
func (*Component) PackageName ¶
func (*Component) PluginStopFuncs ¶
PluginStopFuncs 获取stop hook
func (*Component) Send ¶
func (c *Component) Send(key string, req *SendRequest) (resp *SendResponse)
type ParentPlugin ¶
type ParentPlugin struct { PluginKey string // reg key PluginName string // Name Logger *elog.Component }
func (ParentPlugin) Cron ¶
func (p ParentPlugin) Cron() ecron.Ecron
func (*ParentPlugin) Key ¶
func (p *ParentPlugin) Key() string
func (*ParentPlugin) Name ¶
func (p *ParentPlugin) Name() string
type SendRequest ¶
type SendRequest struct { Receiver string // 接收者 Vars map[string]string // 参数变量 ExtraContent string // 业务方备注 ExtraId string // 业务方扩展id Tpl interface{} // 模板对象 ReceiverDetail interface{} // 接收者详情 }
SendRequest 对业务 pb 不产生依赖
type SendResponse ¶
type SendResponse struct { Code int32 // code ExtraId string // 业务方扩展id MsgId string // msgId Reason string // 详情 FinalContent string // 最终发送内容 PluginType string // 使用的插件 Retry int // 重试次数 }
SendResponse 对业务 pb 不产生依赖
type SenderPlugin ¶
type SenderPlugin interface { Name() string // 名称 Key() string // 唯一 key register Destroy() error // 销毁 Init() error // 初始化 Send(req *SendRequest) (resp *SendResponse) // send Cron() ecron.Ecron // 定时任务 没有可返回nil }
SenderPlugin emns plugins
Click to show internal directories.
Click to hide internal directories.