Documentation ¶
Index ¶
- Constants
- Variables
- type AdminAppRequest
- type AdminAppResponse
- type AdminCertificateRequest
- type AdminSuccessResponse
- type Audience
- type Callback
- type CallbackParam
- type DefaultResponse
- type DeviceAliasResponse
- type DeviceModify
- type DeviceRegistrationIDRequest
- type DeviceRegistrationIDResponse
- type DeviceStatusRequest
- type DeviceStatusResponse
- type DeviceTagsListResponse
- type DeviceTagsRegistrationIDResponse
- type DeviceTagsRequest
- type ErrorMessage
- type ErrorResponse
- type Fcm
- type File
- type GetFilesResponse
- type GroupPush
- type Huawei
- type IconSize
- type ImagesByUrlsRequest
- type ImagesByUrlsResponse
- type ImagesByUrlsUpdateRequest
- type JPush
- func (j *JPush) AdminApp(req **AdminAppRequest) (*AdminAppResponse, error)
- func (j *JPush) AdminAppCert(appkey string, req *AdminCertificateRequest) (*AdminSuccessResponse, error)
- func (j *JPush) AdminAppDelete(appkey string) (*AdminSuccessResponse, error)
- func (j *JPush) DeleteFiles(fileId string) (delete bool, err error)
- func (j *JPush) DeviceDeleteAlias(alias string, platforms []string) (*DefaultResponse, error)
- func (j *JPush) DeviceDeleteTags(tag string, platforms []string) (*DefaultResponse, error)
- func (j *JPush) DeviceGetAlias(alias string, platforms []string) (*DeviceAliasResponse, error)
- func (j *JPush) DeviceGetRegistrationID(registrationID string) (*DeviceRegistrationIDResponse, error)
- func (j *JPush) DeviceGetTags() (*DeviceTagsListResponse, error)
- func (j *JPush) DeviceGetTagsRegistrationID(tag string, registrationID string) (*DeviceTagsRegistrationIDResponse, error)
- func (j *JPush) DevicePostRegistrationID(registrationID string, req *DeviceRegistrationIDRequest) (*DefaultResponse, error)
- func (j *JPush) DevicePostStatus(req *DeviceStatusRequest) (map[string]DeviceStatusResponse, error)
- func (j *JPush) DevicePostTags(tag string, req *DeviceTagsRequest) (*DefaultResponse, error)
- func (j *JPush) GetFiles() (files *GetFilesResponse, err error)
- func (j *JPush) GetURL(key string) string
- func (j *JPush) ImagesByFiles(media string, req ImagesByUrlsUpdateRequest) (*ImagesByUrlsResponse, error)
- func (j *JPush) ImagesByUrls(req ImagesByUrlsRequest) (*ImagesByUrlsResponse, error)
- func (j *JPush) Push(req *PushRequest) (*PushResponse, error)
- func (j *JPush) PushGetCid() (*PushCIDResponse, error)
- func (j *JPush) PushGetCids(count int, cidtype string) (*PushCIDResponse, error)
- func (j *JPush) PushValidate(req *PushRequest) (*PushResponse, error)
- func (j *JPush) ReportMessages(msgIds []string) (*ReportMessagesResponse, error)
- func (j *JPush) ReportMessagesDetail(msgIds []string) ([]ReportDetailResponse, error)
- func (j *JPush) ReportReceived(msgIds []string) ([]ReportReceivedResponse, error)
- func (j *JPush) ReportStatus(req *ReportStatusRequest) (map[string]MessageStatus, error)
- func (j *JPush) ReportUsers(timeUnit string, start time.Time, duration int) (*ReportUsersResponse, error)
- func (j *JPush) Schedule(req *ScheduleRequest) (*ScheduleResponse, error)
- func (j *JPush) ScheduleDelete(scheduleID string) (*DefaultResponse, error)
- func (j *JPush) ScheduleGetCid() (*PushCIDResponse, error)
- func (j *JPush) ScheduleID(scheduleID string) (*ScheduleResponse, error)
- func (j *JPush) ScheduleIDMsgs(scheduleID string) (*ScheduleMsgsResponse, error)
- func (j *JPush) SchedulePage(page int) (*SchedulePageResponse, error)
- func (j *JPush) SchedulePut(scheduleID string, req *ScheduleRequest) (*ScheduleResponse, error)
- func (j *JPush) SendFile(filePath string, typeInt int) (fileId string, err error)
- func (j *JPush) SetAuthorization(key, secret string)
- func (j *JPush) SetZone(zone string)
- type Meizu
- type MessageStatus
- type NotificationAndroid
- type NotificationIOS
- type NotificationWinPhone
- type Oppo
- type Platform
- type PushAudience
- type PushCIDResponse
- type PushMessage
- type PushNotification
- type PushOptions
- type PushRequest
- type PushResponse
- type ReportAndroidMessage
- type ReportDetailResponse
- type ReportIOSMessage
- type ReportMessagesResponse
- type ReportReceivedResponse
- type ReportStatusRequest
- type ReportTime
- type ReportUser
- type ReportUserAndroid
- type ReportUserIOS
- type ReportUsersResponse
- type ReportWpMessage
- type ScheduleMsgsResponse
- type SchedulePageResponse
- type SchedulePeriodical
- type ScheduleRequest
- type ScheduleResponse
- type ScheduleSingle
- type ScheduleTime
- type ScheduleTrigger
- type SmsMessage
- type ThirdPartyChannel
- type Vivo
- type Xiaomi
Constants ¶
const ( TypeAlias = 1 TypeRegistrationId = 2 )
const ( DistributionJPush = "jpush" //值为 jpush 表示推送强制走极光通道下发; DistributionOSPush = "ospush" //值为 ospush 表示推送强制走厂商通道下发; DistributionFirstOSPush = "first_ospush" //值为 first_ospush 时表示推送优先走厂商通道下发,无效走极光通道下发; DistributionSecondaryPush = "secondary_push" //值为 secondary_push 表示推送优先走极光,极光不在线再走厂商,厂商作为辅助;【建议此种方式】 DistributionFcm = "fcm" //值为 fcm 表示推送强制走 fcm 通道下发; DistributionFcmPns = "pns" //值为 pns 表示推送强制走小米/华为/魅族/oppo/vivo 通道下发; DistributionFcmJPush = "jpush" //值为 jpush 表示推送强制走极光通道下发; DistributionFcmSecondaryFcmPush = "secondary_fcm_push" //值为 secondary_fcm_push 表示针对fcm+国内厂商组合类型用户,推送优先走极光,极光不在线再走fcm通道,fcm作为辅助; DistributionFcmSecondaryPnsPush = "secondary_pns_push" //值为 secondary_pns_push 表示针对fcm+国内厂商组合类型用户,推送优先走极光,极光不在线再走厂商通道,厂商作为辅助; )
const ToDevice int32 = 1
const ToUser int32 = 2
const (
VERSION = "1.0"
)
VERSION api client version
Variables ¶
var ZONES = make(map[string]map[string]string)
ZONES define api url
Functions ¶
This section is empty.
Types ¶
type AdminAppRequest ¶
type AdminAppRequest struct { AppName string `json:"app_name"` AndroidPackage string `json:"android_package"` GroupName string `json:"group_name"` }
AdminAppRequest admin app request
type AdminAppResponse ¶
type AdminAppResponse struct { ErrorResponse AppKey string `json:"app_key"` AndroidPackage string `json:"android_package"` IsNewCreated bool `json:"is_new_created"` }
AdminAppResponse new app response
type AdminCertificateRequest ¶
type AdminCertificateRequest struct { DevCertificatePassword string `json:"devCertificatePassword,omitempty"` ProCertificatePassword string `json:"proCertificatePassword,omitempty"` DevCertificateFile []byte `json:"devCertificateFile,omitempty"` ProCertificateFile []byte `json:"proCertificateFile,omitempty"` }
AdminCertificateRequest admin certificate
type AdminSuccessResponse ¶
type AdminSuccessResponse struct { ErrorResponse Success string `json:"success"` }
AdminSuccessResponse success response
type Audience ¶
type Audience struct { Tag []string `json:"tag,omitempty"` TagAnd []string `json:"tag_and,omitempty"` TagNot []string `json:"tag_not,omitempty"` Alias []string `json:"alias,omitempty"` RegistrationID []string `json:"registration_id,omitempty"` Segment []string `json:"segment,omitempty"` ABTest []string `json:"abtest,omitempty"` File *File `json:"file,omitempty"` }
Audience define Audience
type Callback ¶
type Callback struct { Url string `json:"url,omitempty"` Params CallbackParam `json:"params,omitempty"` Type string `json:"type,omitempty"` }
type CallbackParam ¶
type DefaultResponse ¶
type DefaultResponse struct {
ErrorResponse
}
DefaultResponse default null response
type DeviceAliasResponse ¶
type DeviceAliasResponse struct { ErrorResponse RegistrationIDs []string `json:"registration_ids"` }
DeviceAliasResponse get alias response
type DeviceModify ¶
type DeviceModify struct { Add []string `json:"add,omitempty"` Remove []string `json:"remove,omitempty"` }
DeviceModify add and remove entry
type DeviceRegistrationIDRequest ¶
type DeviceRegistrationIDRequest struct { Tags *DeviceModify `json:"tags,omitempty"` Alias string `json:"alias,omitempty"` Mobile string `json:"mobile,omitempty"` }
DeviceRegistrationIDRequest modify device request
type DeviceRegistrationIDResponse ¶
type DeviceRegistrationIDResponse struct { ErrorResponse Tags []string `json:"tags"` Alias string `json:"alias"` Mobile string `json:"mobile,omitempty"` }
DeviceRegistrationIDResponse get registration id response
type DeviceStatusRequest ¶
type DeviceStatusRequest struct {
RegistrationIDs []string `json:"registration_ids,omitempty"`
}
DeviceStatusRequest get user status
type DeviceStatusResponse ¶
type DeviceStatusResponse struct { ErrorResponse Online bool `json:"online"` LastOnlineTime string `json:"last_online_time,omitempty"` }
DeviceStatusResponse get device status response
type DeviceTagsListResponse ¶
type DeviceTagsListResponse struct { ErrorResponse Tags []string `json:"tags"` }
DeviceTagsListResponse get tags list response
type DeviceTagsRegistrationIDResponse ¶
type DeviceTagsRegistrationIDResponse struct { ErrorResponse Result bool `json:"result"` }
DeviceTagsRegistrationIDResponse tags bind registration response
type DeviceTagsRequest ¶
type DeviceTagsRequest struct {
RegistrationIDs *DeviceModify `json:"registration_ids,omitempty"`
}
DeviceTagsRequest modify device named tag request
type ErrorMessage ¶
ErrorMessage error message response
func (ErrorMessage) Error ¶
func (e ErrorMessage) Error() string
type ErrorResponse ¶
type ErrorResponse struct {
Error ErrorMessage `json:"error"`
}
ErrorResponse error response from api
type GetFilesResponse ¶
type GetFilesResponse struct { TotalCount int `json:"total_count"` Files []file `json:"files"` ErrorResponse }
type GroupPush ¶
type GroupPush struct {
JPush
}
GroupPush grouppush core struct
func NewGroupPush ¶
NewGroupPush new grouppush object
func (*GroupPush) GroupPush ¶
func (j *GroupPush) GroupPush(req *PushRequest) (map[string]PushResponse, error)
GroupPush group push POST /v3/grouppush
func (*GroupPush) SetAuthorization ¶
SetAuthorization set grouppush authorization
type Huawei ¶
type Huawei struct { Fcm Importance string `json:"importance,omitempty"` Inbox string `json:"inbox,omitempty"` LargeIcon string `json:"large_icon,omitempty"` OnlyUseVendorStyle bool `json:"only_use_vendor_style,omitempty"` SmallIconURI string `json:"small_icon_uri,omitempty"` Style int64 `json:"style,omitempty"` }
type ImagesByUrlsRequest ¶
type ImagesByUrlsRequest struct { FcmImageURL string `json:"fcm_image_url,omitempty"` HuaweiImageURL string `json:"huawei_image_url,omitempty"` ImageType IconSize `json:"image_type,omitempty"` ImageURL string `json:"image_url,omitempty"` JiguangImageURL string `json:"jiguang_image_url,omitempty"` OppoImageURL string `json:"oppo_image_url,omitempty"` XiaomiImageURL string `json:"xiaomi_image_url,omitempty"` }
type ImagesByUrlsResponse ¶
type ImagesByUrlsResponse struct { FcmImageURL string `json:"fcm_image_url,omitempty"` HuaweiImageURL string `json:"huawei_image_url,omitempty"` JiguangImageURL string `json:"jiguang_image_url,omitempty"` MediaID string `json:"media_id,omitempty"` OppoImageURL string `json:"oppo_image_url,omitempty"` XiaomiImageURL string `json:"xiaomi_image_url,omitempty"` ErrorResponse }
type ImagesByUrlsUpdateRequest ¶
type ImagesByUrlsUpdateRequest struct { FcmImageURL string `json:"fcm_image_url,omitempty"` HuaweiImageURL string `json:"huawei_image_url,omitempty"` JiguangImageURL string `json:"jiguang_image_url,omitempty"` OppoImageURL string `json:"oppo_image_url,omitempty"` XiaomiImageURL string `json:"xiaomi_image_url,omitempty"` }
type JPush ¶
type JPush struct { Zone string Quota int // 当前 AppKey 一个时间窗口内可调用次数 Remaining int // 当前时间窗口剩余的可用次数 Reset int // 距离时间窗口重置剩余的秒数 // contains filtered or unexported fields }
JPush jpush core struct
func (*JPush) AdminApp ¶
func (j *JPush) AdminApp(req **AdminAppRequest) (*AdminAppResponse, error)
AdminApp admin app point POST /v1/admin/app
func (*JPush) AdminAppCert ¶
func (j *JPush) AdminAppCert(appkey string, req *AdminCertificateRequest) (*AdminSuccessResponse, error)
AdminAppCert admin certificate POST /v1/app/{appKey}/certificate
func (*JPush) AdminAppDelete ¶
func (j *JPush) AdminAppDelete(appkey string) (*AdminSuccessResponse, error)
AdminAppDelete delete app POST /v1/app/{appkey}/delete
func (*JPush) DeviceDeleteAlias ¶
func (j *JPush) DeviceDeleteAlias(alias string, platforms []string) (*DefaultResponse, error)
DeviceDeleteAlias delete alias
func (*JPush) DeviceDeleteTags ¶
func (j *JPush) DeviceDeleteTags(tag string, platforms []string) (*DefaultResponse, error)
DeviceDeleteTags delete tag
func (*JPush) DeviceGetAlias ¶
func (j *JPush) DeviceGetAlias(alias string, platforms []string) (*DeviceAliasResponse, error)
DeviceGetAlias get device named alias
func (*JPush) DeviceGetRegistrationID ¶
func (j *JPush) DeviceGetRegistrationID(registrationID string) (*DeviceRegistrationIDResponse, error)
DeviceGetRegistrationID get device info
func (*JPush) DeviceGetTags ¶
func (j *JPush) DeviceGetTags() (*DeviceTagsListResponse, error)
DeviceGetTags get all tag list
func (*JPush) DeviceGetTagsRegistrationID ¶
func (j *JPush) DeviceGetTagsRegistrationID(tag string, registrationID string) (*DeviceTagsRegistrationIDResponse, error)
DeviceGetTagsRegistrationID get device tag
func (*JPush) DevicePostRegistrationID ¶
func (j *JPush) DevicePostRegistrationID(registrationID string, req *DeviceRegistrationIDRequest) (*DefaultResponse, error)
DevicePostRegistrationID modify device info
func (*JPush) DevicePostStatus ¶
func (j *JPush) DevicePostStatus(req *DeviceStatusRequest) (map[string]DeviceStatusResponse, error)
DevicePostStatus get devices status
func (*JPush) DevicePostTags ¶
func (j *JPush) DevicePostTags(tag string, req *DeviceTagsRequest) (*DefaultResponse, error)
DevicePostTags modify device tag
func (*JPush) GetFiles ¶
func (j *JPush) GetFiles() (files *GetFilesResponse, err error)
func (*JPush) ImagesByFiles ¶
func (j *JPush) ImagesByFiles(media string, req ImagesByUrlsUpdateRequest) (*ImagesByUrlsResponse, error)
ImagesByFiles 通过图片文件获取媒体id
func (*JPush) ImagesByUrls ¶
func (j *JPush) ImagesByUrls(req ImagesByUrlsRequest) (*ImagesByUrlsResponse, error)
ImagesByUrls 通过图片地址获取媒体id
func (*JPush) Push ¶
func (j *JPush) Push(req *PushRequest) (*PushResponse, error)
Push push notification or message to devices POST /v3/push
func (*JPush) PushGetCid ¶
func (j *JPush) PushGetCid() (*PushCIDResponse, error)
PushGetCid get push by cid GET /v3/push/cid[?count=n[&type=xx]]
func (*JPush) PushGetCids ¶
func (j *JPush) PushGetCids(count int, cidtype string) (*PushCIDResponse, error)
PushGetCids get push by cid GET /v3/push/cid[?count=n[&type=xx]]
func (*JPush) PushValidate ¶
func (j *JPush) PushValidate(req *PushRequest) (*PushResponse, error)
PushValidate push validate, not real push POST /v3/push/validate
func (*JPush) ReportMessages ¶
func (j *JPush) ReportMessages(msgIds []string) (*ReportMessagesResponse, error)
ReportMessages message stat GET /v3/messages Deprecated: it is old func
func (*JPush) ReportMessagesDetail ¶
func (j *JPush) ReportMessagesDetail(msgIds []string) ([]ReportDetailResponse, error)
ReportMessagesDetail report messages detail GET /v3/messages/detail
func (*JPush) ReportReceived ¶
func (j *JPush) ReportReceived(msgIds []string) ([]ReportReceivedResponse, error)
ReportReceived report received GET /v3/received Deprecated: it is old func
func (*JPush) ReportStatus ¶
func (j *JPush) ReportStatus(req *ReportStatusRequest) (map[string]MessageStatus, error)
ReportStatus report push status POST /v3/status/message
func (*JPush) ReportUsers ¶
func (j *JPush) ReportUsers(timeUnit string, start time.Time, duration int) (*ReportUsersResponse, error)
ReportUsers user stat GET /v3/users
func (*JPush) Schedule ¶
func (j *JPush) Schedule(req *ScheduleRequest) (*ScheduleResponse, error)
Schedule create schedule POST /v3/schedules
func (*JPush) ScheduleDelete ¶
func (j *JPush) ScheduleDelete(scheduleID string) (*DefaultResponse, error)
ScheduleDelete delete schedule DELETE /v3/schedules/{schedule_id}
func (*JPush) ScheduleGetCid ¶
func (j *JPush) ScheduleGetCid() (*PushCIDResponse, error)
ScheduleGetCid get push by cid GET /v3/push/cid[?count=n[&type=xx]]
func (*JPush) ScheduleID ¶
func (j *JPush) ScheduleID(scheduleID string) (*ScheduleResponse, error)
ScheduleID get schedule by id GET /v3/schedules/{schedule_id}
func (*JPush) ScheduleIDMsgs ¶
func (j *JPush) ScheduleIDMsgs(scheduleID string) (*ScheduleMsgsResponse, error)
ScheduleIDMsgs get all msg ids by schedule id GET /v3/schedules/{schedule_id}/msg_ids
func (*JPush) SchedulePage ¶
func (j *JPush) SchedulePage(page int) (*SchedulePageResponse, error)
SchedulePage get schedule list GET /v3/schedules?page=
func (*JPush) SchedulePut ¶
func (j *JPush) SchedulePut(scheduleID string, req *ScheduleRequest) (*ScheduleResponse, error)
SchedulePut modify schedule PUT /v3/schedules/{schedule_id}
func (*JPush) SetAuthorization ¶
SetAuthorization set Authorization
type MessageStatus ¶
type MessageStatus struct {
Status int `json:"status"`
}
MessageStatus message status
type NotificationAndroid ¶
type NotificationAndroid struct { Alert string `json:"alert"` Title string `json:"title,omitempty"` BuilderID int `json:"builder_id,int,omitempty"` Priority int `json:"priority,omitempty"` Category string `json:"category,omitempty"` Style int `json:"style,int,omitempty"` AlertType int `json:"alert_type,int,omitempty"` BigText string `json:"big_text,omitempty"` Inbox map[string]interface{} `json:"inbox,omitempty"` BigPicPath string `json:"big_pic_path,omitempty"` Extras map[string]interface{} `json:"extras,omitempty"` LargeIcon string `json:"large_icon,omitempty"` Intent map[string]interface{} `json:"intent,omitempty"` UriAction string `json:"uri_action,omitempty"` UriActivity string `json:"uri_activity,omitempty"` BadgeAddNum int `json:"badge_add_num,omitempty"` BadgeClass string `json:"badge_class,omitempty"` Sound string `json:"sound,omitempty"` ShowBeginTime string `json:"show_begin_time,omitempty"` ShowEndTime string `json:"show_end_time,omitempty"` DisplayForeground string `json:"display_foreground,omitempty"` SmallIconUri string `json:"small_icon_uri,omitempty"` }
NotificationAndroid define android notification
type NotificationIOS ¶
type NotificationIOS struct { Alert interface{} `json:"alert"` Sound string `json:"sound,omitempty"` Badge int `json:"badge,int,omitempty"` ContentAvailable bool `json:"content-available,omitempty"` MutableContent bool `json:"mutable-content,omitempty"` Category string `json:"category,omitempty"` Extras map[string]interface{} `json:"extras,omitempty"` ThreadId string `json:"thread-id,omitempty"` }
NotificationIOS define ios notification
type NotificationWinPhone ¶
type NotificationWinPhone struct { Alert string `json:"alert"` Title string `json:"title,omitempty"` OpenPage string `json:"_open_page,omitempty"` Extras map[string]interface{} `json:"extras,omitempty"` }
NotificationWinPhone define winphone notification
type Platform ¶
type Platform struct { Platforms []string // contains filtered or unexported fields }
Platform define platform entry
func (*Platform) MarshalJSON ¶
MarshalJSON marshal json
func (*Platform) UnmarshalJSON ¶
UnmarshalJSON unmarshal json
type PushAudience ¶
type PushAudience struct { Aud *Audience // contains filtered or unexported fields }
PushAudience define audience entry
func (*PushAudience) MarshalJSON ¶
func (p *PushAudience) MarshalJSON() (data []byte, err error)
MarshalJSON marshal json
func (*PushAudience) UnmarshalJSON ¶
func (p *PushAudience) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshal json
type PushCIDResponse ¶
type PushCIDResponse struct { ErrorResponse Cids []string `json:"cidlist"` }
PushCIDResponse get cid response
type PushMessage ¶
type PushMessage struct { MsgContent string `json:"msg_content"` Title string `json:"title,omitempty"` ContentType string `json:"content_type,omitempty"` Extras map[string]interface{} `json:"extras,omitempty"` }
PushMessage define push message
type PushNotification ¶
type PushNotification struct { Alert string `json:"alert,omitempty"` Android *NotificationAndroid `json:"android,omitempty"` IOS *NotificationIOS `json:"ios,omitempty"` WinPhone *NotificationWinPhone `json:"winphone,omitempty"` }
PushNotification define notification
type PushOptions ¶
type PushOptions struct { SendNo int `json:"sendno,int,omitempty"` TimeToLive int `json:"time_to_live,int,omitempty"` OverrideMsgID int64 `json:"override_msg_id,int64,omitempty"` ApnsProduction bool `json:"apns_production"` ApnsCollapseID string `json:"apns_collapse_id,omitempty"` BigPushDuration int `json:"big_push_duration,int,omitempty"` ThirdPartyChannel ThirdPartyChannel `json:"third_party_channel,omitempty"` }
PushOptions define options
type PushRequest ¶
type PushRequest struct { Cid string `json:"cid,omitempty"` Platform *Platform `json:"platform"` Audience *PushAudience `json:"audience"` Notification *PushNotification `json:"notification,omitempty"` Message *PushMessage `json:"message,omitempty"` SmsMessage *SmsMessage `json:"sms_message,omitempty"` Options *PushOptions `json:"options,omitempty"` Callback *Callback `json:"callback,omitempty"` }
PushRequest define push request body
type PushResponse ¶
type PushResponse struct { ErrorResponse MsgID string `json:"msg_id"` Sendno string `json:"sendno"` }
PushResponse define push repsone
type ReportAndroidMessage ¶
type ReportAndroidMessage struct { Received int `json:"received,omitempty"` Target int `json:"target,omitempty"` OnlinePush int `json:"online_push,omitempty"` Click int `json:"click,omitempty"` MsgClick int `json:"msg_click,omitempty"` }
ReportAndroidMessage android message
type ReportDetailResponse ¶
type ReportDetailResponse struct { MsgId string `json:"msg_id"` Jpush struct { Target int `json:"target"` OnlinePush int `json:"online_push"` Received int `json:"received"` Click int `json:"click"` MsgClick int `json:"msg_click"` } `json:"jpush"` AndroidPns struct { PnsTarget int `json:"pns_target"` PnsSent int `json:"pns_sent"` PnsReceived int `json:"pns_received"` XmDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"xm_detail"` HwDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"hw_detail"` MzDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"mz_detail"` OppoDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"oppo_detail"` VivoDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"vivo_detail"` FcmDetail struct { Target int `json:"target"` Sent int `json:"sent"` Received int `json:"received"` } `json:"fcm_detail"` } `json:"android_pns"` Ios struct { ApnsTarget int `json:"apns_target"` ApnsSent int `json:"apns_sent"` ApnsReceived int `json:"apns_received"` ApnsClick int `json:"apns_click"` MsgTarget int `json:"msg_target"` MsgReceived int `json:"msg_received"` MsgClick int `json:"msg_click"` } `json:"ios"` Winphone struct { MpnsTarget int `json:"mpns_target"` MpnsSent int `json:"mpns_sent"` Click int `json:"click"` } `json:"winphone"` QuickappJpush struct { Target int `json:"target"` OnlinePush int `json:"online_push"` Received int `json:"received"` Click int `json:"click"` MsgClick int `json:"msg_click"` } `json:"quickapp_jpush"` QuickappPns struct { PnsTarget int `json:"pns_target"` PnsSent int `json:"pns_sent"` } `json:"quickapp_pns"` }
ReportDetailResponse message statistics details
type ReportIOSMessage ¶
type ReportIOSMessage struct { ApnsSent int `json:"apns_sent,omitempty"` ApnsTarget int `json:"apns_target,omitempty"` ApnsReceived int `json:"apns_received,omitempty"` Click int `json:"click,omitempty"` Target int `json:"target,omitempty"` Received int `json:"received,omitempty"` }
ReportIOSMessage ios message
type ReportMessagesResponse ¶
type ReportMessagesResponse struct { ErrorResponse MsgID string `json:"msg_id,omitempty"` Android *ReportAndroidMessage `json:"android,omitempty"` IOS *ReportIOSMessage `json:"ios,omitempty"` Wp *ReportWpMessage `json:"winphone,omitempty"` }
ReportMessagesResponse define report messages
type ReportReceivedResponse ¶
type ReportReceivedResponse struct { ErrorResponse MsgID float64 `json:"msg_id"` AndroidReceived int `json:"android_received"` IOSApnsSent int `json:"ios_apns_sent"` IOSApnsReceived int `json:"ios_apns_received"` IOSMsgReceived int `json:"ios_msg_received"` WpMpnsSent int `json:"wp_mpns_sent"` }
ReportReceivedResponse define report received
type ReportStatusRequest ¶
type ReportStatusRequest struct { MsgID int `json:"msg_id,int"` RegistrationIds []string `json:"registration_ids"` Date *ReportTime `json:"date,omitempty"` }
ReportStatusRequest push message status
type ReportTime ¶
ReportTime report time
func (*ReportTime) MarshalJSON ¶
func (r *ReportTime) MarshalJSON() (data []byte, err error)
MarshalJSON marshal json
func (*ReportTime) UnmarshalJSON ¶
func (r *ReportTime) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshal json
type ReportUser ¶
type ReportUser struct { Time *ReportTime `json:"time"` Android *ReportUserAndroid `json:"android,omitempty"` IOS *ReportUserIOS `json:"ios,omitempty"` }
ReportUser define report user item
type ReportUserAndroid ¶
type ReportUserAndroid struct { New int `json:"new,omitempty"` Active int `json:"active,omitempty"` Online int `json:"online,omitempty"` }
ReportUserAndroid define report android user
type ReportUserIOS ¶
type ReportUserIOS struct { New int `json:"new,omitempty"` Active int `json:"active,omitempty"` Online int `json:"online,omitempty"` }
ReportUserIOS define report ios user
type ReportUsersResponse ¶
type ReportUsersResponse struct { ErrorResponse TimeUnit string `json:"time_unit"` Start *ReportTime `json:"start"` Duration int `json:"duration"` Items []ReportUser `json:"items"` }
ReportUsersResponse define report user response
type ReportWpMessage ¶
type ReportWpMessage struct { MpnsTarget int `json:"mpns_target,omitempty"` MpnsSent int `json:"mpns_sent,omitempty"` Click int `json:"click,omitempty"` }
ReportWpMessage wp message
type ScheduleMsgsResponse ¶
type ScheduleMsgsResponse struct { ErrorResponse Count int `json:"count"` MsgIDs []interface{} `json:"msgids,omitempty"` }
ScheduleMsgsResponse schedule message
type SchedulePageResponse ¶
type SchedulePageResponse struct { ErrorResponse TotalCount int `json:"total_count"` TotalPages int `json:"total_pages"` Page int `json:"page"` Schedules []ScheduleResponse `json:"schedules"` }
SchedulePageResponse schedule page response
type SchedulePeriodical ¶
type SchedulePeriodical struct { Start *ScheduleTime `json:"start,omitempty"` End *ScheduleTime `json:"end,omitempty"` Time string `json:"time,omitempty"` TimeUnit string `json:"time_unit,omitempty"` Frequency int `json:"frequency,int,omitempty"` Point []string `json:"point,omitempty"` }
SchedulePeriodical schedule periodical
type ScheduleRequest ¶
type ScheduleRequest struct { Cid string `json:"cid,omitempty"` Push *PushRequest `json:"push,omitempty"` Name string `json:"name,omitempty"` Enabled bool `json:"enabled,omitempty"` Trigger *ScheduleTrigger `json:"trigger,omitempty"` }
ScheduleRequest schedule request body
type ScheduleResponse ¶
type ScheduleResponse struct { ErrorResponse ScheduleID string `json:"schedule_id"` Name string `json:"name"` Enabled bool `json:"enabled,omitempty"` Trigger *ScheduleTrigger `json:"trigger,omitempty"` Push *PushRequest `json:"push,omitempty"` }
ScheduleResponse new schedule response
type ScheduleSingle ¶
type ScheduleSingle struct {
Time *ScheduleTime `json:"time,omitempty"`
}
type ScheduleTime ¶
ScheduleTime schedule time
func (*ScheduleTime) MarshalJSON ¶
func (s *ScheduleTime) MarshalJSON() (data []byte, err error)
MarshalJSON marshal json
func (*ScheduleTime) UnmarshalJSON ¶
func (s *ScheduleTime) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshal json
type ScheduleTrigger ¶
type ScheduleTrigger struct { Single *ScheduleSingle `json:"single,omitempty"` Periodical *SchedulePeriodical `json:"periodical,omitempty"` }
ScheduleTrigger schedule trigger
type SmsMessage ¶
type SmsMessage struct { DelayTime int `json:"delay_time,int"` TempID float64 `json:"temp_id,float"` TempPara map[string]interface{} `json:"temp_para,omitempty"` }
SmsMessage define sms message
type ThirdPartyChannel ¶
type Xiaomi ¶
type Xiaomi struct { Fcm BigText string `json:"big_text,omitempty"` ChannelID string `json:"channel_id,omitempty"` DistributionCustomize string `json:"distribution_customize,omitempty"` LargeIcon string `json:"large_icon,omitempty"` SmallIconColor string `json:"small_icon_color,omitempty"` SmallIconURI string `json:"small_icon_uri,omitempty"` Style int64 `json:"style,omitempty"` }