Versions in this module Expand all Collapse all v1 v1.0.3 Jun 22, 2019 v1.0.2 Jun 20, 2019 Changes in this version type PushMsgOption + func OptionAndroidIntent(scheme string) PushMsgOption v1.0.0 Aug 30, 2018 Changes in this version + var XingeURL = "https://openapi.xg.qq.com/v3/push/app" + func MakeAuthHeader(appID, secretKey string) string + func NewHttpClient() *http.Client + func PushURL(url string) + type Alert map[string]interface + func (alert Alert) Set(key string, value interface{}) + func (alert Alert) SetActionLocKey(data string) + func (alert Alert) SetBody(content string) + func (alert Alert) SetLaunchImage(data string) + func (alert Alert) SetLocArgs(data []string) + func (alert Alert) SetLocKey(data string) + func (alert Alert) SetTitle(title string) + func (alert Alert) SetTitleLocArgs(data []string) + func (alert Alert) SetTitleLocKey(data string) + func DefaultApsAlert(title string, body string) Alert + type AndroidParams struct + Action map[string]interface{} + BuilderID int + Cleanable int + CustomContent map[string]string + IconRes string + IconType int + Lights int + NID int + Ring int + RingRaw string + SmallIcon int + StyleID int + Vibrate int + func DefaultAndroidParams() *AndroidParams + type Aps struct + Badge int + Category string + ContentAvailable int + Sound string + ThreadId string + func DefaultAps(title string, content string) *Aps + type AudienceType string + const AudienceTypeAccount + const AudienceTypeAccountList + const AudienceTypeAll + const AudienceTypeTag + const AudienceTypeToken + const AudienceTypeTokenList + type Authorization struct + AppID string + SecretKey string + type CommonRsp struct + Environment CommonRspEnv + ErrMsg string + PushID string + Result map[string]string + RetCode int + Seq int64 + type CommonRspEnv string + const EnvDev + const EnvProd + type IAuth interface + func MakeAuthoraztion(appId string, secretKey string) IAuth + type IOSParams struct + Aps *Aps + Custom map[string]string + func DefaultIOSParams(title string, content string) *IOSParams + type IPushMsg interface + RenderOptions func(opts ...PushMsgOption) error + func DefaultPushMsg(platform Platform, msgType MessageType, title string, content string) IPushMsg + func NewAccountNotifyPushMsg(platform Platform, title string, content string, accounts ...string) IPushMsg + func NewAccountPushMsg(platform Platform, msgType MessageType, title string, content string, ...) IPushMsg + func NewPushAllNotifyPushMsg(platform Platform, title string, content string) IPushMsg + func NewPushAllPushMsg(platform Platform, msgType MessageType, title string, content string) IPushMsg + func NewTagNotifyPushMsg(platform Platform, title string, content string, tagOpt TagOperation, ...) IPushMsg + func NewTagPushMsg(platform Platform, msgType MessageType, title string, content string, ...) IPushMsg + func NewTokenNotifyPushMsg(platform Platform, title string, content string, tokens ...string) IPushMsg + func NewTokenPushMsg(platform Platform, msgType MessageType, title string, content string, ...) IPushMsg + type Message struct + AcceptTime []string + Android *AndroidParams + Content string + IOS *IOSParams + Title string + type MessageType string + const MessageTypeOfMsg + const MessageTypeOfNotify + type Platform string + const PlatformAndroid + const PlatformiOS + type PushMsg struct + AccountList []string + AccountType int + Environment CommonRspEnv + ExpireTime int + LoopTimes int + MultiPkg bool + PushID string + SendTime string + Seq int64 + StatTag string + TagList *TagList + TokenList []string + func (rst *PushMsg) RenderOptions(opts ...PushMsgOption) error + type PushMsgOption func(*PushMsg) error + func OptionAccountList(al ...string) PushMsgOption + func OptionAccountListAdd(a string) PushMsgOption + func OptionAccountType(at int) PushMsgOption + func OptionAddAction(k string, v interface{}) PushMsgOption + func OptionAndroidParams(params *AndroidParams) PushMsgOption + func OptionAps(aps *Aps) PushMsgOption + func OptionApsAlert(alert Alert) PushMsgOption + func OptionApsBadage(badge int) PushMsgOption + func OptionApsCategory(category string) PushMsgOption + func OptionApsContentAvailable(contentAvailable int) PushMsgOption + func OptionApsSound(sound string) PushMsgOption + func OptionApsThreadId(threadId string) PushMsgOption + func OptionBuilderID(id int) PushMsgOption + func OptionCleanable(c int) PushMsgOption + func OptionContent(c string) PushMsgOption + func OptionCustomContent(ct map[string]string) PushMsgOption + func OptionCustomContentSet(k, v string) PushMsgOption + func OptionEnvDevelop() PushMsgOption + func OptionEnvProduction() PushMsgOption + func OptionExpireTime(et time.Time) PushMsgOption + func OptionIOSParams(params *IOSParams) PushMsgOption + func OptionIconRes(ir string) PushMsgOption + func OptionIconType(it int) PushMsgOption + func OptionLights(l int) PushMsgOption + func OptionLoopTimes(lt int) PushMsgOption + func OptionMessage(m Message) PushMsgOption + func OptionMessageType(t MessageType) PushMsgOption + func OptionMultiPkg(mp bool) PushMsgOption + func OptionNID(id int) PushMsgOption + func OptionPlatAndroid() PushMsgOption + func OptionPlatIos() PushMsgOption + func OptionPlatform(p Platform) PushMsgOption + func OptionPushID(pid string) PushMsgOption + func OptionRing(ring int) PushMsgOption + func OptionRingRaw(rr string) PushMsgOption + func OptionSendTime(st time.Time) PushMsgOption + func OptionSeq(s int64) PushMsgOption + func OptionSmallIcon(si int) PushMsgOption + func OptionStatTag(st string) PushMsgOption + func OptionStyleID(s int) PushMsgOption + func OptionTagList(op TagOperation, tags ...string) PushMsgOption + func OptionTagListOpt2(tl TagList) PushMsgOption + func OptionTitle(t string) PushMsgOption + func OptionTokenList(tl ...string) PushMsgOption + func OptionTokenListAdd(t string) PushMsgOption + func OptionVibrate(v int) PushMsgOption + type TagList struct + Tags []string + type TagOperation string + const TagOperationAnd + const TagOperationOr + type XgClient struct + func NewXingeClient(androidAuth IAuth, iOSAuth IAuth, client *http.Client) XgClient + func NewXingeClient3() XgClient + func NewXingeClientent2(appId string, secretKey string, platform Platform) XgClient + func (xg *XgClient) SetAndroidAuth(auth IAuth) + func (xg *XgClient) SetAuth(appId string, secretKey string, platform Platform) + func (xg *XgClient) SetIOSAuth(auth IAuth) + func (xg XgClient) MarshalResp(resp *http.Response) CommonRsp + func (xg XgClient) Push(msg IPushMsg) CommonRsp + func (xg XgClient) PushWithAuthorization(msg IPushMsg, auth IAuth) CommonRsp