pushmsg

package
v0.0.0-...-bd18503 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BIND_Tag   = "BindTag"
	UNBIND_Tag = "UnbindTag"
	LIST_Tags  = "ListTags"
	QUERY_Tags = "QueryTags"
)
View Source
var (
	AliCloudAppKey      = "23665956" // 23636409
	AliCloudAccessKeyId = "WC9nreih4P8Mbwwz"
	AlicloudAppSecret   = "HVllgK8DF9pvURVnTm0dtbFIqS8e6l"
)

Functions

func CommonParams

func CommonParams(pmtp *PushMsgParameter) url.Values

CommonParams 公共参数部分

func GetAliSignature

func GetAliSignature(par *PushMsgParameter) (string, url.Values)

func PushMessage

func PushMessage(action string, users interface{}, m *PushClientMessage) (bool, *res)

func Signature

func Signature(key, resource string) (signature string, err error)

Types

type AliPushMsg

type AliPushMsg struct {
	ClientMsg PushClientMessage
}

func (*AliPushMsg) SendDelayedmsg

func (a *AliPushMsg) SendDelayedmsg(target string) bool

type AliRespInfo

type AliRespInfo struct {
	Code      string
	Message   string
	RequestId string
	MessageId string
	HostId    string
}

func AddAliMessageTag

func AddAliMessageTag(action string, tagname string, clientKey string) (bool, *AliRespInfo)

AddAliMessageTag 添加Tag

func AliPushMessage

func AliPushMessage(action string, users interface{}, client_msg *AliPushMsg) (bool, *AliRespInfo)

func AliPushNotice

func AliPushNotice(action string, users interface{}, client_msg *AliPushMsg) (bool, *AliRespInfo)

func Ali_resp_to_unmarshal

func Ali_resp_to_unmarshal(resp *http.Response) (bool, *AliRespInfo)

xml 解析

func QueryTags

func QueryTags(clientKey, keyType string) (bool, *AliRespInfo)

QueryTags 查询某个对象的Tag列表

func TagList

func TagList() (bool, *AliRespInfo)

TagList 查询全部Tag列表

func UnbindTag

func UnbindTag(clientKey string, tags ...string) (bool, *AliRespInfo)

UnbindTag 解绑Tag

type PushClientMessage

type PushClientMessage struct {
	Id int64

	NamePerson         string
	Birthday           string
	Name               string
	FromName           string
	FromUserName       string
	RoomName           string
	MsgFromType        string
	MsgType            string
	MsgNotificationStr string
	Img                string
	Title              string
	NoticeTitle        string
	Summary            string
	Content            string
	Status             bool
	IsClick            bool //可点
	CreateDate         time.Time
	ResponseDate       time.Time
}

type PushMsgParameter

type PushMsgParameter struct {
	AccessKeyId string
	Action      string
	RegionId    string
	//Devices          string
	Signature        string
	SignatureNonce   string
	SignatureVersion string
	SignatureMethod  string // = HMAC-SHA1
	Version          string
	Timestamp        string
	AppKey           string
	Target           string // 推送目标类别 :DEVICE:根据设备推送 ACCOUNT:根据账号推送 ALIAS:根据别名推送  TAG:根据标签推送 ALL:推送给全部设备
	TargetValue      string //
	//tag
	TagName   string
	ClientKey string // 接受者
	KeyType   string // Tag推送的 推送类型

	DeviceType    string // 设备类别 : all
	PushType      string // 消息类别: 1:msg 2: notice
	Title         string // 消息头
	Body          string // 消息内容
	ApnsEnv       string
	IOSApnsEnv    string // IOS APNs 环境  DEV表示开发环境,PRODUCT表示生产环境
	ExtParameters string // 自定义消息结构  json串

	AndroidExtParameters       string // 消息 andriod
	AndroidNotificationBarType int    // andriod 通知栏样式
	StoreOffline               string // 用户不在线,72小时内会重新发送消息
	//AndroidOpenType            string // Activity  有效
	AndroidActivity          string
	AndroidXiaoMiActivity    string
	AndroidXiaoMiNotifyTitle string
	AndroidXiaoMiNotifyBody  string
	// contains filtered or unexported fields
}

push message 请求参数

type TagInfo

type TagInfo struct {
	RoomKey        string
	UserName       string
	EnterpriseName string
}

func (*TagInfo) GetTagapi

func (tg *TagInfo) GetTagapi(action string) (bool, *AliRespInfo)

Jump to

Keyboard shortcuts

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