Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProclaimTypeAll ProclaimType = "all" //全部 ProclaimTypeNamespace = "namespace" //业务线 ProclaimTypeUser = "user" //指定用户 )
View Source
const (
AlarmAction = "Alarm" //告警
)
View Source
const (
ProclaimAction = "Proclaim" //公告
)
Variables ¶
View Source
var ErrProclaimType = errors.New("不支持的公告类型")
不支持消息动作类型
View Source
var ErrWechatSend = errors.New("微信消息推送失败")
Functions ¶
This section is empty.
Types ¶
type NoticeMqData ¶
type NoticeMqData struct { WebHooksReq event.WebhooksRequest Notice types.Notices FromOs string }
通知消息类型-MQ
type ServiceAlarm ¶
type ServiceAlarm interface { DistributeAlarm(ctx context.Context, data string) (err error) CreateAlarmMember(ctx context.Context, ml []types.Member, notice types.Notices, al alarm) (num int, err error) SendAlarmEmail(toUser, toCc []string, notice types.Notices) (err error) }
func NewServiceAlarm ¶
func NewServiceAlarm(logger log.Logger, cf *config.Config, mailClient email.EmailInterface, amqpClient amqpClient.AmqpClient, store repository.Repository) ServiceAlarm
*
- @Title 处理消费出来的 alarm 的数据
type ServiceNotice ¶
type ServiceNotice interface { DistributeNotice(ctx context.Context, data string) error CreateNoticeMember(ml []types.Member, notice *NoticeMqData) (num int, err error) SendNoticeEmail(toUser, toCc []string, notice NoticeMqData) (err error) }
func NewServiceNotice ¶
func NewServiceNotice(logger log.Logger, cf *config.Config, mailClient email.EmailInterface, amqpClient amqpClient.AmqpClient, store repository.Repository) ServiceNotice
*
- @Title 处理消费出来的 notice 的数据
type ServiceProclaim ¶
type ServiceProclaim interface { DistributeProclaim(ctx context.Context, data string) error CreateProclaimMember(ml []types.Member, notice *types.Notices) (num int, err error) SendProclaimEmail(toUser, toCc []string, notice types.Notices) (err error) }
func NewServiceProclaim ¶
func NewServiceProclaim(logger log.Logger, cf *config.Config, mailClient email.EmailInterface, amqpClient amqpClient.AmqpClient, store repository.Repository) ServiceProclaim
*
- @Title 处理消费出来的 alarm 的数据
type ServiceWechatQueue ¶
type ServiceWechatQueue interface { PublicWechatQueue(m types.Member, notice types.Notices, createdName string) (err error) PublicNoticeQueue(req *event.WebhooksRequest) (err error) PublicProclaimQueue(proclaim *types.Notices) (err error) DistributeMsgWechat(ctx context.Context, data string) (err error) }
func NewServiceWechatQueue ¶
func NewServiceWechatQueue(logger log.Logger, cf *config.Config, amqpClient amqpClient.AmqpClient, wxClient *wechat.Wechat, store repository.Repository) ServiceWechatQueue
*
- @Title 将待发送至微信的消息放到队列
type TemplateMsg ¶
type WechatNotice ¶
type WechatNotice struct { Id int64 `json:"id"` Type int `json:"type"` Action string `json:"action"` Name string `json:"name"` Namespace string `json:"namespace"` Title string `json:"title"` Content string `json:"content"` CreatedAt time.Time `json:"created_at"` CreatedName string `json:"created_name"` ToUser string `json:"to_user"` }
Click to show internal directories.
Click to hide internal directories.