Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppReqBody ¶
type AppReqBody struct {
Message Message `json:"message"`
Notification Notification `json:"notification"`
Condition []AppReqBodyCondition `json:"condition"`
RequestID string `json:"requestid"`
}
AppReqBody 个推请求body toapp 参考资料 http://docs.getui.com/server/rest/push/#5-toapp
type AppReqBodyCondition ¶
type AppReqBodyCondition struct {
Key string `json:"key"`
Values []string `json:"values"`
OptType string `json:"opt_type"`
}
AppReqBodyCondition toapp 过滤条件 参考资料 http://docs.getui.com/server/rest/push/#5-toapp
type Client ¶
type Client interface {
PushToSingle(SingleReqBody) (*RspBody, error)
PushToList(ListReqBody) (*RspBody, error)
PushToApp(AppReqBody) (*RspBody, error)
StopTask(string) (*RspBody, error)
UserStatus(string) (*UserStatus, error)
CloseAuth() (*RspBody, error)
UserExisted(string) (bool, error)
AuthToken() string
}
Client 客户端接口
type InitParams ¶
type InitParams struct {
AppID string
AppSecret string
AppKey string
MasterSecret string
// AuthHeartbeat Auth刷新时间 单位小时 默认20小时
AuthHeartbeat time.Duration
}
InitParams 初始化参数
type ListReqBody ¶
type ListReqBody struct {
Message Message `json:"message"`
Notification Notification `json:"notification"`
CID []string `json:"cid,omitempty"`
Alias string `json:"alias,omitempty"`
PushInfo PushInfo `json:"push_info"`
TaskID string `json:"taskid"`
NeedDetail bool `json:"need_detail"`
OfflineExpireTime int64 `json:"-"`
}
ListReqBody 个推请求body list 参考资料 http://docs.getui.com/server/rest/push/#4-tolist
type Message ¶
type Message struct {
AppKey string `json:"appkey"`
IsOffline bool `json:"is_offline"`
MsgType string `json:"msgtype"`
}
Message 请求消息配置 Message
type Notification ¶
type Notification struct {
Style struct {
Type int `json:"type"`
Text string `json:"text"`
Title string `json:"title"`
Logo string `json:"logo"`
IsRing bool `json:"is_ring"`
IsVibrate bool `json:"is_vibrate"`
} `json:"style"`
TransmissionType bool `json:"transmission_type"`
TransmissionContent string `json:"transmission_content"`
}
Notification 请求消息配置 Notification 资料 http://docs.getui.com/server/rest/template/
type PushInfo ¶
type PushInfo struct {
Aps struct {
Alert struct {
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
} `json:"alert"`
AutoBadge string `json:"autoBadge,omitempty"`
ContentAvailable int `json:"content-available,omitempty"`
} `json:"aps"`
Multimedia []PushInfoMultimedia `json:"multimedia,omitempty"`
}
PushInfo 推送信息
type PushInfoMultimedia ¶
type PushInfoMultimedia struct {
URL string `json:"url,omitempty"`
Type int `json:"type,omitempty"`
OnlyWifi bool `json:"only_wifi,omitempty"`
}
PushInfoMultimedia 推送消息多媒体信息
type RspBody ¶
type RspBody struct {
Result string `json:"result"`
TaskID string `json:"taskid"`
Desc string `json:"desc"`
Status string `json:"status"`
RequestID string `json:"requestID,omitempty"`
}
RspBody 个推Rsp body 个推请求返回的结构 status : successed_offline 离线下发
successed_online 在线下发 successed_ignore 非活跃用户不下发
type SaveListBody ¶
type SaveListBody struct {
Message saveListBodymessage `json:"message"`
Notification Notification `json:"notification"`
}
SaveListBody 保存消息共同体 list推时有需要先把消息共同体保存到个推,再发送推送到客户端的请求
type SingleReqBody ¶
type SingleReqBody struct {
Message Message `json:"message"`
Notification Notification `json:"notification"`
CID string `json:"cid,omitempty"`
Alias string `json:"alias,omitempty"`
RequestID string `json:"requestid"`
PushInfo PushInfo `json:"push_info"`
}
SingleReqBody 个推请求body 单推 参考资料 http://docs.getui.com/server/rest/push/#3
Click to show internal directories.
Click to hide internal directories.