Documentation ¶
Index ¶
- Constants
- func CreateSignature(StringToSign string) string
- func GatTargetTypeString(target TargetType) string
- func GetPushTypeString(push PushType) string
- func GetTargetValue(target TargetType, values []string) string
- func GetUtcTime(timestamp int64) string
- func PercentEncode(str string) string
- type CancelPushParam
- type FcmMessage
- type FcmNotification
- type PlatformType
- type PushParam
- type PushResult
- type PushServer
- type PushType
- type TargetType
- type UserMsgList
Constants ¶
View Source
const ( AccessKeyId = "LTAIfOTQF8zTIScp" AccessKeySecret = "q0PtOWIDjIriDGsjylajsjkoqLntho" AndroidAppKey = "24656190" IOSAppKey = "dadfda" )
View Source
const ( FcmServerKey = "" /* 152-byte string literal not displayed */ FcmServerUrl = "https://fcm.googleapis.com/fcm/send" )
Variables ¶
This section is empty.
Functions ¶
func CreateSignature ¶
func GatTargetTypeString ¶
func GatTargetTypeString(target TargetType) string
func GetPushTypeString ¶
func GetTargetValue ¶
func GetTargetValue(target TargetType, values []string) string
func GetUtcTime ¶
func PercentEncode ¶
Types ¶
type CancelPushParam ¶
type CancelPushParam struct {
MsgID string
}
type FcmMessage ¶
type FcmMessage struct { Token string `json:"to"` Notification FcmNotification `json:"notification"` }
type FcmNotification ¶
type PlatformType ¶
type PlatformType int32
const ( PlatformTypeAndroid PlatformType = 1 + iota // android PlatformTypeIOS // ios PlatformTypeAll // all )
type PushParam ¶
type PushParam struct { ID uint64 Uid uint64 TargetType TargetType Targets []string PushType PushType Title string Body string PushTime uint64 // 定时推送, 0表示立即推送 PlatformType PlatformType MsgType proto.PushMsgType }
type PushResult ¶
type PushServer ¶
type PushServer struct {
// contains filtered or unexported fields
}
var (
PushServerInstance *PushServer
)
func (*PushServer) CancelPushMsg ¶
func (this *PushServer) CancelPushMsg(id uint64)
func (*PushServer) CancelPushMsgByType ¶
func (this *PushServer) CancelPushMsgByType(id uint64, msgType proto.PushMsgType)
func (*PushServer) GetNextID ¶
func (this *PushServer) GetNextID() uint64
func (*PushServer) PushMsg ¶
func (this *PushServer) PushMsg(msg *PushParam)
type TargetType ¶
type TargetType int32
const ( TargetTypeAccount TargetType = 1 + iota // 账号 TargetTypeDevice // 设备号 TargetTypeAll // 全部(群发) TargetTypeAlias // 别名 TargetTypeTag // tag )
type UserMsgList ¶
Click to show internal directories.
Click to hide internal directories.