代码拉取完成,页面将自动刷新
package im
import (
"context"
"gitee.com/h79/goim/session"
)
type Alarm interface {
Alarm(ctx context.Context, code int32, level int32, title, detail string, err error)
}
type AlarmFunc func(ctx context.Context, code int32, level int32, title, detail string, err error)
func (f AlarmFunc) Alarm(ctx context.Context, code int32, level int32, title, detail string, err error) {
f(ctx, code, level, title, detail, err)
}
const (
MQMsg = iota + 1
EVMsg
)
type MsgInterceptor interface {
MsgInterceptor(ctx context.Context, from *session.Session, to *Connect, payloadType int, payload any) error
}
type MsgInterceptorFunc func(ctx context.Context, from *session.Session, to *Connect, payloadType int, payload any) error
func (f MsgInterceptorFunc) MsgInterceptor(ctx context.Context, from *session.Session, to *Connect, payloadType int, payload any) error {
return f(ctx, from, to, payloadType, payload)
}
// RespInterceptor 回复拦截器
type RespInterceptor interface {
RespInterceptor(req *EventReq) bool
}
type RespInterceptorFunc func(req *EventReq) bool
func (f RespInterceptorFunc) RespInterceptor(req *EventReq) bool {
return f(req)
}
type DisposeInterceptor func(conn *Connect, req *EventReq) (interface{}, error)
type UnaryDisposeInterceptor func(conn *Connect, req *EventReq, handler DisposeInterceptor) (resp any, err error)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。