push

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 CreateSignature(StringToSign string) string

func GatTargetTypeString

func GatTargetTypeString(target TargetType) string

func GetPushTypeString

func GetPushTypeString(push PushType) string

func GetTargetValue

func GetTargetValue(target TargetType, values []string) string

func GetUtcTime

func GetUtcTime(timestamp int64) string

func PercentEncode

func PercentEncode(str string) string

Types

type CancelPushParam

type CancelPushParam struct {
	MsgID string
}

type FcmMessage

type FcmMessage struct {
	Token        string          `json:"to"`
	Notification FcmNotification `json:"notification"`
}

type FcmNotification

type FcmNotification struct {
	Body  string `json:"body"`
	Title string `json:"title"`
}

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 PushResult struct {
	RequestId string
	MessageId string
}

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 PushType

type PushType int32
const (
	PushTypeMessage PushType = 1 + iota // 消息
	PushTypeNotice                      // 通知
)

type TargetType

type TargetType int32
const (
	TargetTypeAccount TargetType = 1 + iota // 账号
	TargetTypeDevice                        // 设备号
	TargetTypeAll                           // 全部(群发)
	TargetTypeAlias                         // 别名
	TargetTypeTag                           // tag
)

type UserMsgList

type UserMsgList struct {
	Msgs []*PushParam
	sync.RWMutex
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL