Versions in this module Expand all Collapse all v1 v1.0.1 Nov 9, 2022 v1.0.0 Nov 9, 2022 Changes in this version + const CHARSET + const CONTENT_TYPE_FORM + const CONTENT_TYPE_JSON + const DEFAULT_CONNECT_TIMEOUT + const DEFAULT_READ_WRITE_TIMEOUT + const HOST_CID + const HOST_PUSH + const HOST_REPORT + const HOST_SCHEDULE + const SUCCESS_FLAG + func SendGet(url, appKey, masterSecret string) (string, error) + func SendPostBytes(url string, content []byte, appKey, masterSecret string) (string, error) + func SendPostBytes2(url string, data []byte, appKey, masterSecret string) (string, error) + func SendPostString(url string, content, appKey, masterSecret string) (string, error) + func TimeoutDialer(connectTimeout time.Duration, readWriteTimeout time.Duration) func(net, addr string) (c net.Conn, err error) + func UnmarshalResponse(resp string) (map[string]interface{}, error) + type AndroidNotification struct + Alert interface{} + AlertType int + BadgeAddNum int + BadgeClass string + BigPicPath string + BigText string + BuilderID int + Category string + ChannelId string + DisplayForeground string + Extras map[string]interface{} + Inbox interface{} + Intent interface{} + LargeIcon string + Priority int + ShowBeginTime string + ShowEndTime string + SmallIconUri string + Sound string + Style int + Title interface{} + UriAction string + UriActivity string + type Audience struct + Object interface{} + func (a *Audience) All() + func (a *Audience) Interface() interface{} + func (a *Audience) SetABTest(abtests []string) + func (a *Audience) SetAlias(aliases []string) + func (a *Audience) SetID(ids []string) + func (a *Audience) SetSegment(segments []string) + func (a *Audience) SetTag(tags []string) + func (a *Audience) SetTagAnd(tags []string) + func (a *Audience) SetTagNot(tags []string) + type AudienceType string + const ABTEST + const ALIAS + const REGISTRATION_ID + const SEGMENT + const TAG + const TAG_AND + const TAG_NOT + func (a AudienceType) String() string + type CallBack struct + Params map[string]interface{} + Type string + Url string + func (c *CallBack) SetParams(params map[string]interface{}) + func (c *CallBack) SetType(t string) + func (c *CallBack) SetUrl(url string) + type CidRequest struct + Count int + Type string + func NewCidRequest(count int, push_type string) *CidRequest + func (c *CidRequest) GetCidList(key, secret string) (*CidResponse, error) + func (c CidRequest) String() string + type CidResponse struct + CidList []string + func (c CidResponse) String() string + type HttpRequest struct + func Delete(url string) *HttpRequest + func Get(url string) *HttpRequest + func Post(url string) *HttpRequest + func Put(url string) *HttpRequest + func (h *HttpRequest) Bytes() ([]byte, error) + func (h *HttpRequest) GetCookie(key string) string + func (h *HttpRequest) GetHeader() http.Header + func (h *HttpRequest) GetParam(key string) string + func (h *HttpRequest) Response() (*http.Response, error) + func (h *HttpRequest) SetBasicAuth(username, password string) *HttpRequest + func (h *HttpRequest) SetBody(body interface{}) *HttpRequest + func (h *HttpRequest) SetCookie(cookie *http.Cookie) *HttpRequest + func (h *HttpRequest) SetHeader(key, value string) *HttpRequest + func (h *HttpRequest) SetParam(key, value string) *HttpRequest + func (h *HttpRequest) SetProtocolVersion(vers string) *HttpRequest + func (h *HttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *HttpRequest + func (h *HttpRequest) SetQueryParam(key, value string) *HttpRequest + func (h *HttpRequest) SetTLSConfig(config *tls.Config) *HttpRequest + func (h *HttpRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *HttpRequest + func (h *HttpRequest) SetTransport(transport http.RoundTripper) *HttpRequest + func (h *HttpRequest) SetUserAgent(useragent string) *HttpRequest + func (h *HttpRequest) Status() int + func (h *HttpRequest) String() (string, error) + func (h *HttpRequest) ToFile(file string) error + func (h *HttpRequest) ToJson(v interface{}) error + func (h *HttpRequest) ToXml(v interface{}) error + type InappMessage struct + InAppMessage bool + func (i *InappMessage) SetInAppMessage(inAppMessage bool) + type IosNotification struct + Alert interface{} + Badge interface{} + Category string + ContentAvailable bool + Extras map[string]interface{} + InterruptionLevel string + MutableContent bool + Sound interface{} + ThreadId string + type JPushClient struct + AppKey string + MasterSecret string + func NewJPushClient(appKey string, masterSecret string) *JPushClient + func (j *JPushClient) CreateSchedule(data []byte) (string, error) + func (j *JPushClient) DeleteSchedule(id string) (string, error) + func (j *JPushClient) GetAuthorization() string + func (j *JPushClient) GetCid(count int, push_type string) ([]byte, error) + func (j *JPushClient) GetReport(msg_ids string) (string, error) + func (j *JPushClient) GetSchedule(id string) (string, error) + func (j *JPushClient) Push(data []byte) (string, error) + type Message struct + ContentType string + Extras map[string]interface{} + MsgContent string + Title string + func (m *Message) AddExtras(key string, value interface{}) + func (m *Message) SetContent(content string) + func (m *Message) SetContentType(contentType string) + func (m *Message) SetExtras(extras map[string]interface{}) + func (m *Message) SetTitle(title string) + type Notification struct + AiOpportunity bool + Alert string + Android *AndroidNotification + Ios *IosNotification + QuickApp *QuickAppNotification + Voip map[string]interface{} + WinPhone *WinPhoneNotification + func (n *Notification) SetAiOpportunity(use bool) + func (n *Notification) SetAlert(alert string) + func (n *Notification) SetAndroid(android *AndroidNotification) + func (n *Notification) SetIos(ios *IosNotification) + func (n *Notification) SetQuickApp(quickApp *QuickAppNotification) + func (n *Notification) SetVoip(value map[string]interface{}) + func (n *Notification) SetWinPhone(winPhone *WinPhoneNotification) + type Notification3rd struct + BadgeAddNum string + BadgeClass string + ChannelId string + Content string + Extras map[string]interface{} + Sound string + Title string + UriAction string + UriActivity string + func (n *Notification3rd) SetBadgeAddNum(badgeAddNum string) + func (n *Notification3rd) SetBadgeClass(badgeClass string) + func (n *Notification3rd) SetChannelId(channelId string) + func (n *Notification3rd) SetContent(content string) error + func (n *Notification3rd) SetExtras(extras map[string]interface{}) + func (n *Notification3rd) SetSound(sound string) + func (n *Notification3rd) SetTitle(title string) + func (n *Notification3rd) SetUriAction(uriAction string) + func (n *Notification3rd) SetUriActivity(uriActivity string) + type Options struct + ApnsCollapseId string + ApnsProduction bool + BigPushDuration int + OverrideMsgId int + SendNo int + ThirdPartyChannel ThirdPartyChannel + TimeToLive int + func (o *Options) AddThirdPartyChannel(channel ThirdChannelType, value ThirdPartyOptions) + func (o *Options) SetApnsProduction(apnsProduction bool) + func (o *Options) SetBigPushDuration(bigPushDuration int) + func (o *Options) SetOverrideMsgId(overrideMsgId int) + func (o *Options) SetSendNo(sendNo int) + func (o *Options) SetTimeToLive(timeToLive int) + type PayLoad struct + Audience *Audience + Cid string + Message *Message + Notification *Notification + Options *Options + Platform *Platform + func NewPayLoad() *PayLoad + func (p *PayLoad) Bytes() ([]byte, error) + func (p *PayLoad) SetAudience(audience *Audience) + func (p *PayLoad) SetMessage(message *Message) + func (p *PayLoad) SetNotification(notification *Notification) + func (p *PayLoad) SetOptions(options *Options) + func (p *PayLoad) SetPlatform(platform *Platform) + type Platform struct + Os interface{} + func (p *Platform) Add(os PlatformType) error + func (p *Platform) AddAndroid() + func (p *Platform) AddIOS() + func (p *Platform) AddWinphone() + func (p *Platform) All() + func (p *Platform) Interface() interface{} + func (p *Platform) Remove(os PlatformType) error + type PlatformType string + const ANDROID + const IOS + const WINPHONE + type QuickAppNotification struct + Alert string + Extras map[string]interface{} + Page string + Title string + type Schecule struct + Cid string + Enabled bool + Name string + Push *PayLoad + Trigger map[string]interface{} + func NewSchedule(cid, name string, enabled bool, push *PayLoad) *Schecule + func (s *Schecule) Bytes() ([]byte, error) + func (s *Schecule) GetCid() string + func (s *Schecule) GetEnabled() bool + func (s *Schecule) GetName() string + func (s *Schecule) PeriodicalTrigger(start, end, t time.Time, timeUnit string, frequency int, point []string) + func (s *Schecule) SetCid(cid string) + func (s *Schecule) SetEnabled(enabled bool) + func (s *Schecule) SetName(name string) + func (s *Schecule) SetPayLoad(push *PayLoad) + func (s *Schecule) SingleTrigger(t time.Time) + type SmsMessage struct + ActiveFilter bool + DelayTime int + Signid int + TempId int64 + TempPara interface{} + func (s *SmsMessage) SetActiveFilter(activeFilter bool) + func (s *SmsMessage) SetDelayTime(delayTime int) + func (s *SmsMessage) SetSignid(signid int) + func (s *SmsMessage) SetTempId(tempId int64) + func (s *SmsMessage) SetTempPara(tempPara interface{}) + type ThirdChannelType string + const FCM + const HUAWEI + const MEIZU + const OPPO + const VIVO + const XIAOMI + func (t ThirdChannelType) String() string + type ThirdPartyChannel struct + type ThirdPartyOptions struct + BigPicPath string + BigText string + Category string + ChannelId string + Classification string + Distribution string + DistributionCustomize string + DistributionFcm string + Importance string + Inbox interface{} + LargeIcon string + OnlyUseVendorStyle bool + PushMode int + SkipQuota bool + SmallIconColor string + SmallIconUri string + Style int + Urgency string + type WinPhoneNotification struct + Alert string + Extras map[string]interface{} + OpenPage string + Title string