Skip to content

Commit

Permalink
Add CI github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytaxii committed May 26, 2024
1 parent 98d19ba commit e3b5ddb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
golangci:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gomeng
# gomeng ![CI Status](https://github.com/crazytaxii/gomeng/actions/workflows/ci.yaml/badge.svg)

友盟消息推送 Golang SDK
友盟开发者中心 U-Push API 集成文档:[传送门](https://developer.umeng.com/docs/66632/detail/68343)
Expand Down
14 changes: 4 additions & 10 deletions push.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@ package gomeng

import "context"

/**
* 推送给单用户(单播)
*/
// 推送给单用户(单播)
func (c *Client) Unicast(ctx context.Context, payload Payload, deviceToken string) (resp *ResponseMessage, err error) {
return c.doPost(ctx, c.genRequestParams(payload, unicastRequest, deviceToken), apiPush)
}

/**
* 推送给多用户(列播)
*/
// 推送给多用户(列播)
func (c *Client) ListCast(ctx context.Context, payload Payload, deviceTokens ...string) (resp *ResponseMessage, err error) {
return c.doPost(ctx, c.genRequestParams(payload, listcastRequest, deviceTokens...), apiPush)
}

/**
* 推送给所有用户(广播)
* 默认每天可推送10次
*/
// 推送给所有用户(广播)
// 默认每天只可推送10次
func (c *Client) Broadcast(ctx context.Context, payload Payload) (resp *ResponseMessage, err error) {
return c.doPost(ctx, c.genRequestParams(payload, broadcastRequest), apiBroadcast)
}

0 comments on commit e3b5ddb

Please sign in to comment.