Documentation ¶
Index ¶
- Constants
- Variables
- func NewUmengError(code int, msg string) error
- type AddTemplateResp
- type App
- func (a *App) AddTag(device string, tag string) (err error)
- func (a *App) AddTags(device string, tags []string) (err error)
- func (a *App) AddTemplate(template interface{}) (templateId string, err error)
- func (a *App) Cancel(taskId string) (ret CancelResp, err error)
- func (a *App) Channel(taskId string) (ret ChannelData, err error)
- func (a *App) ClearTags(device string) (err error)
- func (a *App) DeleteTag(device string, tag string) (err error)
- func (a *App) DeleteTags(device string, tags []string) (err error)
- func (a *App) DeleteTemplate(templateId string) (err error)
- func (a *App) GetMsg(templateMsgId string, limit int, cursor string) (ret []Msg, last string, err error)
- func (a *App) GetTemplate(templateId string) (ret *Template, err error)
- func (a *App) GetTemplateCount() int
- func (a *App) ListTags(device string) (tags []string, err error)
- func (a *App) ListTemplate(page int, limit int) (ret *ListTemplateData, err error)
- func (a *App) Quota() (ret QuotaData, err error)
- func (a *App) Request(uri string, reqBody interface{}) (content []byte, err error)
- func (a *App) SendTemplateMsg(templateId string, data []interface{}) (templateMsgId string, err error)
- func (a *App) SetTags(device string, tags []string) (err error)
- func (a *App) Sign(url string, body string) string
- func (a *App) Status(taskId string) (ret StatusData, err error)
- func (a *App) Upload(content string) (fileId string, err error)
- func (a *App) UploadFile(file string) (fileId string, err error)
- type CancelReq
- type CancelResp
- type ChannelData
- type ChannelErr
- type ChannelReq
- type ChannelResp
- type ListTemplateData
- type ListTemplateReq
- type ListTemplateResp
- type Msg
- type MsgReq
- type MsgResp
- type QuotaData
- type QuotaReq
- type QuotaResp
- type SendTemplateMsgReq
- type SendTemplateMsgResp
- type StatusData
- type StatusReq
- type StatusResp
- type Template
- type TemplateReq
- type TemplateResp
- type Umeng
- func (u *Umeng) Debug(debug bool) *Umeng
- func (u *Umeng) GetApp(platform string) *App
- func (u *Umeng) InitAndroid(appkey string, secret string) *Umeng
- func (u *Umeng) InitIOS(appkey string, secret string) *Umeng
- func (u *Umeng) SetPackageName(packageName string) *Umeng
- func (u *Umeng) UseProxy(addr string)
- type UmengError
- type UmengErrorResp
- type UploadReq
- type UploadResp
Constants ¶
View Source
const ( Host string = "https://msgapi.umeng.com" SendPath string = "/api/send" StatusPath string = "/api/status" ChannelPath string = "/api/channel/data" QuotaPath string = "/api/quota/query" CancelPath string = "/api/cancel" UploadPath string = "/upload" TagAddPath string = "/api/tag/add" TagListPath string = "/api/tag/list" TagSetPath string = "/api/tag/set" TagDeletePath string = "/api/tag/delete" TagClearPath string = "/api/tag/clear" TmplAddPath string = "/api/template/add" TmplDeletePath string = "/api/template/delete" TmplGetPath string = "/api/template/get" TmplListPath string = "/api/template/list" TmplSendPath string = "/api/template/send" TmplMsgPath string = "/api/template/msg" IOS string = "ios" Android string = "android" )
Variables ¶
View Source
var Proxy string
Functions ¶
func NewUmengError ¶
Types ¶
type AddTemplateResp ¶
type App ¶
type App struct { AppKey string MasterSecret string Platform string PackageName string // 包名(安卓离线推送需要) Debug bool }
func (*App) AddTemplate ¶
func (*App) DeleteTemplate ¶
func (*App) GetTemplateCount ¶
func (*App) ListTemplate ¶
func (a *App) ListTemplate(page int, limit int) (ret *ListTemplateData, err error)
func (*App) SendTemplateMsg ¶
type CancelResp ¶
type ChannelData ¶
type ChannelData struct { Stats []struct { Channel string `json:"channel"` ChannelArriveCount int `json:"channel_arrive_count"` ChannelClick int `json:"channel_click"` ChannelSentCount int `json:"channel_sent_count"` Errors []ChannelErr `json:"errors"` } `json:"stats"` }
type ChannelErr ¶
type ChannelReq ¶
type ChannelResp ¶
type ChannelResp struct { Ret string `json:"ret"` Data ChannelData `json:"data"` }
type ListTemplateData ¶
type ListTemplateReq ¶
type ListTemplateResp ¶
type ListTemplateResp struct { Ret string `json:"ret"` Data ListTemplateData `json:"data"` }
type QuotaData ¶
type QuotaData struct { VivoSysMsgCount string `json:"vivoSysMsgCount"` XmAckedCount string `json:"xmAckedCount"` OppoTotalCount string `json:"oppoTotalCount"` XmQuotaCount string `json:"xmQuotaCount"` OppoPushCount string `json:"oppoPushCount"` VivoMarketMsgCount string `json:"vivoMarketMsgCount"` OppoRemainCount string `json:"oppoRemainCount"` }
type SendTemplateMsgReq ¶
type SendTemplateMsgResp ¶
type StatusData ¶
type StatusData struct { TaskId string `json:"task_id"` Status int64 `json:"status"` // 消息状态:0排队中 1发送中 2发送完成 3发送失败 4消息被撤销 5消息过期 6筛选结果为空 7定时任务尚未开始处理 OpenCount int64 `json:"open_count"` // android/ios共有:打开数 SentCount int64 `json:"sent_count"` // android/ios共有:消息收到数(android) APNs返回SUCCESS的设备数(ios) DismissCount int64 `json:"dismiss_count"` // android特有:忽略数 TotalCount int64 `json:"total_count"` // ios特有:投递APNs设备数 }
type StatusResp ¶
type StatusResp struct { Ret string `json:"ret"` Data StatusData `json:"data"` }
type TemplateReq ¶
type TemplateResp ¶
type Umeng ¶
func (*Umeng) SetPackageName ¶
type UmengError ¶
type UmengError struct { ErrorCode interface{} `json:"error_code"` ErrorMsg string `json:"error_msg"` }
func (*UmengError) Error ¶
func (e *UmengError) Error() string
type UmengErrorResp ¶
type UmengErrorResp struct { Ret string `json:"ret"` Data *UmengError `json:"data"` }
type UploadResp ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.