getui

package
v0.0.0-...-4702bed Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PushURL      = "/push/single/alias"
	AuthURL      = "/auth"
	TaskURL      = "/push/list/message"
	BatchPushURL = "/push/list/alias"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

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

type Android

type Android struct {
	Ups struct {
		Notification Notification `json:"notification"`
		Options      Options      `json:"options"`
	} `json:"ups"`
}

type Audience

type Audience struct {
	Alias []string `json:"alias"`
}

type AuthReq

type AuthReq struct {
	Sign      string `json:"sign"`
	Timestamp string `json:"timestamp"`
	Appkey    string `json:"appkey"`
}

type AuthResp

type AuthResp struct {
	ExpireTime string `json:"expire_time"`
	Token      string `json:"token"`
}

type Getui

type Getui struct{}
var (
	GetuiClient *Getui

	TokenExpireError = errors.New("token expire")
)

func (*Getui) Auth

func (g *Getui) Auth(operationID string, timeStamp int64) (token string, expireTime int64, err error)

func (*Getui) GetTaskID

func (g *Getui) GetTaskID(operationID, token string, pushReq PushReq) (string, error)

func (*Getui) GetTaskIDAndSave2Redis

func (g *Getui) GetTaskIDAndSave2Redis(operationID, token string, pushReq PushReq) (taskID string, err error)

func (*Getui) Push

func (g *Getui) Push(userIDList []string, title, detailContent, operationID string, opts push.PushOpts) (resp string, err error)

type GetuiCommonResp

type GetuiCommonResp struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type HO

type HO struct {
	Importance string `json:"/android/notification/importance"`
}

type HW

type HW struct {
	Category     string `json:"/message/android/category"`
	DefaultSound bool   `json:"/message/android/notification/default_sound"`
	ChannelID    string `json:"/message/android/notification/channel_id"`
	Sound        string `json:"/message/android/notification/sound"`
	Importance   string `json:"/message/android/notification/importance"`
}

type Ios

type Ios struct {
	NotiType  *string `json:"type"`
	AutoBadge *string `json:"auto_badge"`
	Aps       struct {
		Sound string `json:"sound"`
		Alert Alert  `json:"alert"`
	} `json:"aps"`
}

type Notification

type Notification struct {
	Title       string `json:"title"`
	Body        string `json:"body"`
	ChannelID   string `json:"channelID"`
	ChannelName string `json:"ChannelName"`
	ClickType   string `json:"click_type"`
}

type OP

type OP struct {
	ChannelID string `json:"/channel_id"`
}

type Options

type Options struct {
	HW *HW `json:"HW"`
	XM *XM `json:"XM"`
	VV *VV `json:"VV"`
	OP *OP `json:"OP"`
	HO *HO `json:"HO"`
}

type PushChannel

type PushChannel struct {
	Ios     *Ios     `json:"ios"`
	Android *Android `json:"android"`
}

type PushMessage

type PushMessage struct {
	Notification *Notification `json:"notification,omitempty"`
	Transmission *string       `json:"transmission,omitempty"`
}

type PushReq

type PushReq struct {
	RequestID   *string      `json:"request_id"`
	Settings    *Settings    `json:"settings"`
	Audience    *Audience    `json:"audience"`
	PushMessage *PushMessage `json:"push_message"`
	PushChannel *PushChannel `json:"push_channel"`
	IsAsync     *bool        `json:"is_async"`
	Taskid      *string      `json:"taskid"`
}

type PushResp

type PushResp struct {
}

type Settings

type Settings struct {
	TTL *int64 `json:"ttl"`
}

type TaskResp

type TaskResp struct {
	TaskID string `json:"taskID"`
}

type VV

type VV struct {
	Classification int `json:"/classification"`
}

type XM

type XM struct {
	ChannelID string `json:"/extra.channel_id"`
}

Jump to

Keyboard shortcuts

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