jpush

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndroidNotification

type AndroidNotification struct {
	Alert      string      `json:"alert"`
	Title      string      `json:"title,omitempty"`
	AlertType  int         `json:"alert_type,omitempty"`
	BuilderID  int         `json:"builder_id,omitempty"`
	Style      int         `json:"style,omitempty"`
	BigPicPath string      `json:"big_pic_path,omitempty"`
	Extras     interface{} `json:"extras,omitempty"`
}

AndroidNotification .

type Audience

type Audience struct {
	Tag     interface{} `json:"tag,omitempty"`
	TagAnd  interface{} `json:"tag_and,omitempty"`
	TagNot  interface{} `json:"tag_not,omitempty"`
	Alias   interface{} `json:"alias,omitempty"`
	RegID   interface{} `json:"registration_id,omitempty"`
	Segment interface{} `json:"segment,omitempty"`
	AbTest  interface{} `json:"abtest,omitempty"`
}

Audience .

type Client

type Client struct {
	Auth    string
	Stats   stat.Stat
	Timeout time.Duration
}

Client for JPush

func New

func New(appKey string, secretKey string, timeout time.Duration) *Client

New .

func (*Client) GetTimeout

func (clt *Client) GetTimeout() time.Duration

GetTimeout .

func (*Client) Push

func (clt *Client) Push(b []byte) (resp []byte, err error)

Push .

type IOSAlert

type IOSAlert struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

IOSAlert .

type IOSNotification

type IOSNotification struct {
	Alert            interface{} `json:"alert"`
	Sound            string      `json:"sound,omitempty"`
	Badge            int32       `json:"badge,omitempty"`
	ContentAvailable bool        `json:"content-available,omitempty"`
	MutableContent   bool        `json:"mutable-content,omitempty"`
	Category         string      `json:"category,omitempty"`
	Extras           interface{} `json:"extras,omitempty"`
}

IOSNotification .

type Message

type Message struct {
	Title       string      `json:"title"`
	ContentType string      `json:"content_type"`
	MsgContent  string      `json:"msg_content"`
	Extras      interface{} `json:"extras"`
}

Message .

type Notification

type Notification struct {
	Android *AndroidNotification `json:"android,omitempty"`
	IOS     *IOSNotification     `json:"ios,omitempty"`
}

Notification .

type Option

type Option struct {
	SendNo          int   `json:"sendno,omitempty"`
	TimeLive        int   `json:"time_to_live,omitempty"`
	ApnsProduction  bool  `json:"apns_production"`
	OverrideMsgID   int64 `json:"override_msg_id,omitempty"`
	BigPushDuration int   `json:"big_push_duration,omitempty"`
}

Option .

type Payload

type Payload struct {
	CID          string      `json:"cid,omitempty"`
	Platform     interface{} `json:"platform"`
	Audience     interface{} `json:"audience"`
	Notification interface{} `json:"notification,omitempty"`
	Message      interface{} `json:"message,omitempty"`
	Options      *Option     `json:"options,omitempty"`
}

Payload .

Jump to

Keyboard shortcuts

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