Documentation
¶
Index ¶
- Constants
- type APNS
- type BasePayload
- type BaseRTCPayload
- type ChannelReq
- type DB
- type Event
- type FIREBASEPayload
- type FIREBASEPush
- type HMSPayload
- type HMSPush
- type IOSPayload
- type IOSPush
- type MIPayload
- type MIPush
- type MsgResp
- type OPPOPayload
- type OPPOPush
- type Payload
- type PayloadInfo
- type Push
- type RTCPayload
- type VIVOPayload
- type VIVOPush
- type Webhook
Constants ¶
const EventMsgNotify = "msg.notify"
EventMsgNotify 消息通知 (所有消息)
const EventMsgOffline = "msg.offline"
EventMsgOffline 离线消息
const EventOnlineStatus = "user.onlinestatus"
EventOnlineStatus 在线状态
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasePayload ¶
type BasePayload struct {
// contains filtered or unexported fields
}
BasePayload 基础负载
func (*BasePayload) GetRTCPayload ¶
func (p *BasePayload) GetRTCPayload() RTCPayload
type BaseRTCPayload ¶
type BaseRTCPayload struct {
BasePayload
// contains filtered or unexported fields
}
func (*BaseRTCPayload) GetCallType ¶
func (b *BaseRTCPayload) GetCallType() common.RTCCallType
func (*BaseRTCPayload) GetFromUID ¶
func (b *BaseRTCPayload) GetFromUID() string
func (*BaseRTCPayload) GetOperation ¶
func (b *BaseRTCPayload) GetOperation() string
func (*BaseRTCPayload) GetRTCPayload ¶
func (b *BaseRTCPayload) GetRTCPayload() RTCPayload
type ChannelReq ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB DB
func (*DB) GetGroupName ¶
GetGroupName 获取群名
type Event ¶
type Event struct {
Event string `json:"event"` // 事件标示
Data interface{} `json:"data"` // 事件数据
}
Event Event
type FIREBASEPayload ¶
type FIREBASEPayload struct {
Payload
// contains filtered or unexported fields
}
FIREBASEPayload Google Firebase负载
func NewFIREBASEPayload ¶
func NewFIREBASEPayload(payloadInfo *PayloadInfo, notifyID string) *FIREBASEPayload
NewFIREBASEPayload NewFIREBASEPayload
type FIREBASEPush ¶
FIREBASEPush 参考代码 https://github.com/firebase/firebase-admin-go/blob/61c6c041bf807c045f6ff3fd0d02fc480f806c9a/snippets/messaging.go#L29-L55 FIREBASEPush GOOGLE推送
func NewFIREBASEPush ¶
func NewFIREBASEPush(jsonPath string, packageName string, projectID string, channelID string) *FIREBASEPush
NewFIREBASEPush NewFIREBASEPush
func (*FIREBASEPush) GetPayload ¶
func (m *FIREBASEPush) GetPayload(msg msgOfflineNotify, ctx *config.Context, toUser *user.Resp) (Payload, error)
GetPayload 获取推送负载
type HMSPayload ¶
type HMSPayload struct {
Payload
// contains filtered or unexported fields
}
HMSPayload 华为负载
func NewHMSPayload ¶
func NewHMSPayload(payloadInfo *PayloadInfo, accessToken string) *HMSPayload
NewHMSPayload NewHMSPayload
type HMSPush ¶
HMSPush 华为推送
func NewHMSPush ¶
NewHMSPush NewHMSPush
func (*HMSPush) GetHMSAccessToken ¶
GetHMSAccessToken 获取华为的访问Token
type IOSPush ¶
IOSPush IOSPush
func NewIOSPush ¶
NewIOSPush NewIOSPush
type MIPayload ¶
type MIPayload struct {
Payload
// contains filtered or unexported fields
}
MIPayload 小米负载
func NewMIPayload ¶
func NewMIPayload(payloadInfo *PayloadInfo, notifyID string) *MIPayload
NewMIPayload NewMIPayload
type MIPush ¶
MIPush 小米推送
type MsgResp ¶
type MsgResp struct {
Header messageHeader `json:"header"` // 消息头部
Setting uint8 `json:"setting"` // setting
ClientMsgNo string `json:"client_msg_no"`
MessageID int64 `json:"message_id"` // 服务端的消息ID(全局唯一)
MessageSeq uint32 `json:"message_seq"` // 消息序列号 (用户唯一,有序递增)
FromUID string `json:"from_uid"` // 发送者UID
ToUID string `json:"to_uid"` // 接受者uid
ChannelID string `json:"channel_id"` // 频道ID
ChannelType uint8 `json:"channel_type"` // 频道类型
Expire uint32 `json:"expire"` // 消息过期时间(单位秒)
Timestamp int32 `json:"timestamp"` // 服务器消息时间戳(10位,到秒)
Payload []byte `json:"payload"` // 消息内容
ContentType int // 消息正文类型
PayloadMap map[string]interface{}
}
MsgResp MsgResp
type OPPOPayload ¶
type OPPOPayload struct {
Payload
// contains filtered or unexported fields
}
OPPOPayload oppo负载
func NewOPPOPayload ¶
func NewOPPOPayload(payloadInfo *PayloadInfo, notifyID string) *OPPOPayload
NewOPPOPayload NewOPPOPayload
type OPPOPush ¶
OPPO 推送
func NewOPPOPush ¶
NewOPPOPush NewOPPOPush
func (*OPPOPush) GetPayload ¶
func (o *OPPOPush) GetPayload(msg msgOfflineNotify, ctx *config.Context, toUser *user.Resp) (Payload, error)
GetPayload GetPayload
type Payload ¶
type Payload interface {
GetTitle() string // 推送标题
GetContent() string // 推送正文
GetBadge() int // 推送红点
GetRTCPayload() RTCPayload // 获取rtc的payload
}
Payload 推送内容
func NewIOSPayload ¶
func NewIOSPayload(payloadInfo *PayloadInfo) Payload
NewIOSPayload NewIOSPayload
type PayloadInfo ¶
type PayloadInfo struct {
Title string
Content string
Badge int
// ------ 以下是rtc推送需要 ------
IsVideoCall bool // 是否是rtc消息
FromUID string // rtc消息需要
CallType common.RTCCallType
Operation string
}
func ParsePushInfo ¶
func ParsePushInfo(msgResp msgOfflineNotify, ctx *config.Context, toUser *user.Resp) (*PayloadInfo, error)
ParsePushInfo 解析推送信息 获得title,content,badge
type Push ¶
type Push interface {
GetPayload(msg msgOfflineNotify, ctx *config.Context, toUser *user.Resp) (Payload, error)
Push(deviceToken string, payload Payload) error
}
Push Push
type RTCPayload ¶
type RTCPayload interface {
GetCallType() common.RTCCallType // 音视频呼叫类型
GetOperation() string // 音视频操作 invite: 邀请音视频 cancel:取消邀请
GetFromUID() string // 发起人的uid
}
type VIVOPayload ¶
type VIVOPayload struct {
Payload
// contains filtered or unexported fields
}
VIVOPayload VIVO负载
func NewVIVOPayload ¶
func NewVIVOPayload(payloadInfo *PayloadInfo, notifyID string) *VIVOPayload
NewVIVOPayload NewVIVOPayload
type VIVOPush ¶
VIVO 推送
func NewVIVOPush ¶
NewVIVOPush NewVIVOPush
type Webhook ¶
type Webhook struct {
log.Log
wkhook.UnimplementedWebhookServiceServer
// contains filtered or unexported fields
}
Webhook Webhook