chore: rename gorush to notify package (#609)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2021-07-24 01:56:33 +08:00 committed by GitHub
parent ce6e87639a
commit d9947ea44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 73 additions and 73 deletions

View File

@ -6,7 +6,7 @@ DEPLOY_ACCOUNT := appleboy
DEPLOY_IMAGE := $(EXECUTABLE) DEPLOY_IMAGE := $(EXECUTABLE)
GOFMT ?= gofumpt -l -s -extra GOFMT ?= gofumpt -l -s -extra
TARGETS ?= linux darwin windows openbsd TARGETS ?= linux darwin windows
ARCHS ?= amd64 ARCHS ?= amd64
GOFILES := $(shell find . -name "*.go" -type f) GOFILES := $(shell find . -name "*.go" -type f)
TAGS ?= sqlite TAGS ?= sqlite

40
main.go
View File

@ -16,8 +16,8 @@ import (
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core" "github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/gorush"
"github.com/appleboy/gorush/logx" "github.com/appleboy/gorush/logx"
"github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/appleboy/gorush/queue/nsq" "github.com/appleboy/gorush/queue/nsq"
"github.com/appleboy/gorush/queue/simple" "github.com/appleboy/gorush/queue/simple"
@ -116,7 +116,7 @@ func main() {
} }
// Initialize push slots for concurrent iOS pushes // Initialize push slots for concurrent iOS pushes
gorush.MaxConcurrentIOSPushes = make(chan struct{}, cfg.Ios.MaxConcurrentPushes) notify.MaxConcurrentIOSPushes = make(chan struct{}, cfg.Ios.MaxConcurrentPushes)
if opts.Ios.KeyPath != "" { if opts.Ios.KeyPath != "" {
cfg.Ios.KeyPath = opts.Ios.KeyPath cfg.Ios.KeyPath = opts.Ios.KeyPath
@ -176,7 +176,7 @@ func main() {
} }
if cfg.Core.HTTPProxy != "" { if cfg.Core.HTTPProxy != "" {
err = gorush.SetProxy(cfg.Core.HTTPProxy) err = notify.SetProxy(cfg.Core.HTTPProxy)
if err != nil { if err != nil {
logx.LogError.Fatalf("Set Proxy error: %v", err) logx.LogError.Fatalf("Set Proxy error: %v", err)
@ -193,7 +193,7 @@ func main() {
// send android notification // send android notification
if opts.Android.Enabled { if opts.Android.Enabled {
cfg.Android.Enabled = opts.Android.Enabled cfg.Android.Enabled = opts.Android.Enabled
req := gorush.PushNotification{ req := notify.PushNotification{
Cfg: cfg, Cfg: cfg,
Platform: core.PlatFormAndroid, Platform: core.PlatFormAndroid,
Message: message, Message: message,
@ -210,7 +210,7 @@ func main() {
req.To = topic req.To = topic
} }
err := gorush.CheckMessage(req) err := notify.CheckMessage(req)
if err != nil { if err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
@ -219,7 +219,7 @@ func main() {
return return
} }
gorush.PushToAndroid(req) notify.PushToAndroid(req)
return return
} }
@ -227,7 +227,7 @@ func main() {
// send huawei notification // send huawei notification
if opts.Huawei.Enabled { if opts.Huawei.Enabled {
cfg.Huawei.Enabled = opts.Huawei.Enabled cfg.Huawei.Enabled = opts.Huawei.Enabled
req := gorush.PushNotification{ req := notify.PushNotification{
Cfg: cfg, Cfg: cfg,
Platform: core.PlatFormHuawei, Platform: core.PlatFormHuawei,
Message: message, Message: message,
@ -244,7 +244,7 @@ func main() {
req.To = topic req.To = topic
} }
err := gorush.CheckMessage(req) err := notify.CheckMessage(req)
if err != nil { if err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
@ -253,7 +253,7 @@ func main() {
return return
} }
gorush.PushToHuawei(req) notify.PushToHuawei(req)
return return
} }
@ -265,7 +265,7 @@ func main() {
} }
cfg.Ios.Enabled = opts.Ios.Enabled cfg.Ios.Enabled = opts.Ios.Enabled
req := gorush.PushNotification{ req := notify.PushNotification{
Cfg: cfg, Cfg: cfg,
Platform: core.PlatFormIos, Platform: core.PlatFormIos,
Message: message, Message: message,
@ -282,7 +282,7 @@ func main() {
req.Topic = topic req.Topic = topic
} }
err := gorush.CheckMessage(req) err := notify.CheckMessage(req)
if err != nil { if err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
@ -291,15 +291,15 @@ func main() {
return return
} }
if err := gorush.InitAPNSClient(cfg); err != nil { if err := notify.InitAPNSClient(cfg); err != nil {
return return
} }
gorush.PushToIOS(req) notify.PushToIOS(req)
return return
} }
if err = gorush.CheckPushConf(cfg); err != nil { if err = notify.CheckPushConf(cfg); err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
@ -353,23 +353,23 @@ func main() {
} }
}) })
// gorush.InitQueue(cfg.Core.WorkerNum, cfg.Core.QueueNum) // notify.InitQueue(cfg.Core.WorkerNum, cfg.Core.QueueNum)
// gorush.InitWorkers(ctx, wg, cfg.Core.WorkerNum, cfg.Core.QueueNum) // notify.InitWorkers(ctx, wg, cfg.Core.WorkerNum, cfg.Core.QueueNum)
if cfg.Ios.Enabled { if cfg.Ios.Enabled {
if err = gorush.InitAPNSClient(cfg); err != nil { if err = notify.InitAPNSClient(cfg); err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
} }
if cfg.Android.Enabled { if cfg.Android.Enabled {
if _, err = gorush.InitFCMClient(cfg, cfg.Android.APIKey); err != nil { if _, err = notify.InitFCMClient(cfg, cfg.Android.APIKey); err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
} }
if cfg.Huawei.Enabled { if cfg.Huawei.Enabled {
if _, err = gorush.InitHMSClient(cfg, cfg.Huawei.AppSecret, cfg.Huawei.AppID); err != nil { if _, err = notify.InitHMSClient(cfg, cfg.Huawei.AppSecret, cfg.Huawei.AppID); err != nil {
logx.LogError.Fatal(err) logx.LogError.Fatal(err)
} }
} }
@ -399,7 +399,7 @@ func main() {
} }
} }
// Version control for gorush. // Version control for notify.
var Version = "No Version Provided" var Version = "No Version Provided"
var usageStr = ` var usageStr = `

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"bytes" "bytes"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"log" "log"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"github.com/appleboy/go-fcm" "github.com/appleboy/go-fcm"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"log" "log"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"errors" "errors"
@ -8,12 +8,12 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/appleboy/go-fcm"
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core" "github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/logx" "github.com/appleboy/gorush/logx"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/appleboy/go-fcm"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/msalihkarakasli/go-hms-push/push/model" "github.com/msalihkarakasli/go-hms-push/push/model"
) )

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"crypto/ecdsa" "crypto/ecdsa"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"log" "log"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"os" "os"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"context" "context"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"testing" "testing"

View File

@ -1,4 +1,4 @@
package gorush package notify
import ( import (
"testing" "testing"

View File

@ -6,7 +6,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/appleboy/gorush/gorush" "github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/nsqio/go-nsq" "github.com/nsqio/go-nsq"
@ -77,11 +77,11 @@ func NewWorker(opts ...Option) *Worker {
// In this case, a message with an empty body is simply ignored/discarded. // In this case, a message with an empty body is simply ignored/discarded.
return nil return nil
} }
var notification *gorush.PushNotification var notification *notify.PushNotification
if err := json.Unmarshal(msg.Body, &notification); err != nil { if err := json.Unmarshal(msg.Body, &notification); err != nil {
return err return err
} }
gorush.SendNotification(notification) notify.SendNotification(notification)
return nil return nil
}, },
} }

View File

@ -4,7 +4,7 @@ import (
"errors" "errors"
"runtime" "runtime"
"github.com/appleboy/gorush/gorush" "github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
) )
@ -84,7 +84,7 @@ func NewWorker(opts ...Option) *Worker {
w := &Worker{ w := &Worker{
queueNotification: make(chan queue.QueuedMessage, runtime.NumCPU()<<1), queueNotification: make(chan queue.QueuedMessage, runtime.NumCPU()<<1),
runFunc: func(msg queue.QueuedMessage) error { runFunc: func(msg queue.QueuedMessage) error {
gorush.SendNotification(msg) notify.SendNotification(msg)
return nil return nil
}, },
} }

View File

@ -5,8 +5,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/appleboy/gorush/gorush"
"github.com/appleboy/gorush/logx" "github.com/appleboy/gorush/logx"
"github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@ -29,7 +29,7 @@ func TestQueueUsage(t *testing.T) {
assert.Equal(t, runtime.NumCPU()<<1, w.Capacity()) assert.Equal(t, runtime.NumCPU()<<1, w.Capacity())
assert.Equal(t, 0, w.Usage()) assert.Equal(t, 0, w.Usage())
w.Queue(&gorush.PushNotification{}) w.Queue(&notify.PushNotification{})
assert.Equal(t, 1, w.Usage()) assert.Equal(t, 1, w.Usage())
} }
@ -38,14 +38,14 @@ func TestMaxCapacity(t *testing.T) {
assert.Equal(t, 2, w.Capacity()) assert.Equal(t, 2, w.Capacity())
assert.Equal(t, 0, w.Usage()) assert.Equal(t, 0, w.Usage())
assert.NoError(t, w.Queue(&gorush.PushNotification{})) assert.NoError(t, w.Queue(&notify.PushNotification{}))
assert.Equal(t, 1, w.Usage()) assert.Equal(t, 1, w.Usage())
assert.NoError(t, w.Queue(&gorush.PushNotification{})) assert.NoError(t, w.Queue(&notify.PushNotification{}))
assert.Equal(t, 2, w.Usage()) assert.Equal(t, 2, w.Usage())
assert.Error(t, w.Queue(&gorush.PushNotification{})) assert.Error(t, w.Queue(&notify.PushNotification{}))
assert.Equal(t, 2, w.Usage()) assert.Equal(t, 2, w.Usage())
err := w.Queue(&gorush.PushNotification{}) err := w.Queue(&notify.PushNotification{})
assert.Equal(t, errMaxCapacity, err) assert.Equal(t, errMaxCapacity, err)
} }

View File

@ -11,9 +11,9 @@ import (
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core" "github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/gorush"
"github.com/appleboy/gorush/logx" "github.com/appleboy/gorush/logx"
"github.com/appleboy/gorush/metric" "github.com/appleboy/gorush/metric"
"github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/appleboy/gorush/status" "github.com/appleboy/gorush/status"
@ -65,7 +65,7 @@ func versionHandler(c *gin.Context) {
func pushHandler(cfg config.ConfYaml, q *queue.Queue) gin.HandlerFunc { func pushHandler(cfg config.ConfYaml, q *queue.Queue) gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
var form gorush.RequestPush var form notify.RequestPush
var msg string var msg string
if err := c.ShouldBindWith(&form, binding.JSON); err != nil { if err := c.ShouldBindWith(&form, binding.JSON); err != nil {
@ -228,7 +228,7 @@ func routerEngine(cfg config.ConfYaml, q *queue.Queue) *gin.Engine {
} }
// markFailedNotification adds failure logs for all tokens in push notification // markFailedNotification adds failure logs for all tokens in push notification
func markFailedNotification(cfg config.ConfYaml, notification *gorush.PushNotification, reason string) { func markFailedNotification(cfg config.ConfYaml, notification *notify.PushNotification, reason string) {
logx.LogError.Error(reason) logx.LogError.Error(reason)
for _, token := range notification.Tokens { for _, token := range notification.Tokens {
notification.AddLog(logx.GetLogPushEntry(&logx.InputLog{ notification.AddLog(logx.GetLogPushEntry(&logx.InputLog{
@ -246,10 +246,10 @@ func markFailedNotification(cfg config.ConfYaml, notification *gorush.PushNotifi
} }
// HandleNotification add notification to queue list. // HandleNotification add notification to queue list.
func handleNotification(ctx context.Context, cfg config.ConfYaml, req gorush.RequestPush, q *queue.Queue) (int, []logx.LogPushEntry) { func handleNotification(ctx context.Context, cfg config.ConfYaml, req notify.RequestPush, q *queue.Queue) (int, []logx.LogPushEntry) {
var count int var count int
wg := sync.WaitGroup{} wg := sync.WaitGroup{}
newNotification := []*gorush.PushNotification{} newNotification := []*notify.PushNotification{}
if cfg.Core.Sync && !core.IsLocalQueue(core.Queue(cfg.Queue.Engine)) { if cfg.Core.Sync && !core.IsLocalQueue(core.Queue(cfg.Queue.Engine)) {
cfg.Core.Sync = false cfg.Core.Sync = false

View File

@ -13,7 +13,7 @@ import (
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core" "github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/gorush" "github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/queue" "github.com/appleboy/gorush/queue"
"github.com/appleboy/gorush/queue/simple" "github.com/appleboy/gorush/queue/simple"
"github.com/appleboy/gorush/status" "github.com/appleboy/gorush/status"
@ -291,7 +291,7 @@ func TestEmptyNotifications(t *testing.T) {
// notifications is empty. // notifications is empty.
r.POST("/api/push"). r.POST("/api/push").
SetJSON(gofight.D{ SetJSON(gofight.D{
"notifications": []gorush.PushNotification{}, "notifications": []notify.PushNotification{},
}). }).
Run(routerEngine(cfg, q), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) { Run(routerEngine(cfg, q), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
assert.Equal(t, http.StatusBadRequest, r.Code) assert.Equal(t, http.StatusBadRequest, r.Code)
@ -322,7 +322,7 @@ func TestMutableContent(t *testing.T) {
}, },
}). }).
Run(routerEngine(cfg, q), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) { Run(routerEngine(cfg, q), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
// json: cannot unmarshal number into Go struct field gorush.PushNotification.mutable_content of type bool // json: cannot unmarshal number into Go struct field notify.PushNotification.mutable_content of type bool
assert.Equal(t, http.StatusBadRequest, r.Code) assert.Equal(t, http.StatusBadRequest, r.Code)
}) })
} }
@ -457,7 +457,7 @@ func TestSenMultipleNotifications(t *testing.T) {
cfg.Ios.Enabled = true cfg.Ios.Enabled = true
cfg.Ios.KeyPath = "../certificate/certificate-valid.pem" cfg.Ios.KeyPath = "../certificate/certificate-valid.pem"
err := gorush.InitAPNSClient(cfg) err := notify.InitAPNSClient(cfg)
assert.Nil(t, err) assert.Nil(t, err)
cfg.Android.Enabled = true cfg.Android.Enabled = true
@ -465,8 +465,8 @@ func TestSenMultipleNotifications(t *testing.T) {
androidToken := os.Getenv("ANDROID_TEST_TOKEN") androidToken := os.Getenv("ANDROID_TEST_TOKEN")
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// ios // ios
{ {
Tokens: []string{"11aa01229f15f0f0c52029d8cf8cd0aeaf2365fe4cebc4af26cd6d76b7919ef7"}, Tokens: []string{"11aa01229f15f0f0c52029d8cf8cd0aeaf2365fe4cebc4af26cd6d76b7919ef7"},
@ -493,7 +493,7 @@ func TestDisabledAndroidNotifications(t *testing.T) {
cfg.Ios.Enabled = true cfg.Ios.Enabled = true
cfg.Ios.KeyPath = "../certificate/certificate-valid.pem" cfg.Ios.KeyPath = "../certificate/certificate-valid.pem"
err := gorush.InitAPNSClient(cfg) err := notify.InitAPNSClient(cfg)
assert.Nil(t, err) assert.Nil(t, err)
cfg.Android.Enabled = false cfg.Android.Enabled = false
@ -501,8 +501,8 @@ func TestDisabledAndroidNotifications(t *testing.T) {
androidToken := os.Getenv("ANDROID_TEST_TOKEN") androidToken := os.Getenv("ANDROID_TEST_TOKEN")
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// ios // ios
{ {
Tokens: []string{"11aa01229f15f0f0c5209d8cf8cd0aeaf2365fe4cebc4af26cd6d76b7919ef7"}, Tokens: []string{"11aa01229f15f0f0c5209d8cf8cd0aeaf2365fe4cebc4af26cd6d76b7919ef7"},
@ -529,7 +529,7 @@ func TestSyncModeForNotifications(t *testing.T) {
cfg.Ios.Enabled = true cfg.Ios.Enabled = true
cfg.Ios.KeyPath = "../certificate/certificate-valid.pem" cfg.Ios.KeyPath = "../certificate/certificate-valid.pem"
err := gorush.InitAPNSClient(cfg) err := notify.InitAPNSClient(cfg)
assert.Nil(t, err) assert.Nil(t, err)
cfg.Android.Enabled = true cfg.Android.Enabled = true
@ -540,8 +540,8 @@ func TestSyncModeForNotifications(t *testing.T) {
androidToken := os.Getenv("ANDROID_TEST_TOKEN") androidToken := os.Getenv("ANDROID_TEST_TOKEN")
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// ios // ios
{ {
Tokens: []string{ Tokens: []string{
@ -575,8 +575,8 @@ func TestSyncModeForTopicNotification(t *testing.T) {
// enable sync mode // enable sync mode
cfg.Core.Sync = true cfg.Core.Sync = true
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// android // android
{ {
// error:InvalidParameters // error:InvalidParameters
@ -619,8 +619,8 @@ func TestSyncModeForDeviceGroupNotification(t *testing.T) {
// enable sync mode // enable sync mode
cfg.Core.Sync = true cfg.Core.Sync = true
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// android // android
{ {
To: "aUniqueKey", To: "aUniqueKey",
@ -641,7 +641,7 @@ func TestDisabledIosNotifications(t *testing.T) {
cfg.Ios.Enabled = false cfg.Ios.Enabled = false
cfg.Ios.KeyPath = "../certificate/certificate-valid.pem" cfg.Ios.KeyPath = "../certificate/certificate-valid.pem"
err := gorush.InitAPNSClient(cfg) err := notify.InitAPNSClient(cfg)
assert.Nil(t, err) assert.Nil(t, err)
cfg.Android.Enabled = true cfg.Android.Enabled = true
@ -649,8 +649,8 @@ func TestDisabledIosNotifications(t *testing.T) {
androidToken := os.Getenv("ANDROID_TEST_TOKEN") androidToken := os.Getenv("ANDROID_TEST_TOKEN")
req := gorush.RequestPush{ req := notify.RequestPush{
Notifications: []gorush.PushNotification{ Notifications: []notify.PushNotification{
// ios // ios
{ {
Tokens: []string{"11aa01229f15f0f0c52021d8cf3cd0ae1f2365fe4cebc4af26cd6d76b7919ef7"}, Tokens: []string{"11aa01229f15f0f0c52021d8cf3cd0ae1f2365fe4cebc4af26cd6d76b7919ef7"},

View File

@ -8,8 +8,8 @@ import (
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
"github.com/appleboy/gorush/core" "github.com/appleboy/gorush/core"
"github.com/appleboy/gorush/gorush"
"github.com/appleboy/gorush/logx" "github.com/appleboy/gorush/logx"
"github.com/appleboy/gorush/notify"
"github.com/appleboy/gorush/rpc/proto" "github.com/appleboy/gorush/rpc/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
@ -55,7 +55,7 @@ func (s *Server) Check(ctx context.Context, in *proto.HealthCheckRequest) (*prot
// Send implements helloworld.GreeterServer // Send implements helloworld.GreeterServer
func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*proto.NotificationReply, error) { func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*proto.NotificationReply, error) {
badge := int(in.Badge) badge := int(in.Badge)
notification := gorush.PushNotification{ notification := notify.PushNotification{
Cfg: s.cfg, Cfg: s.cfg,
Platform: int(in.Platform), Platform: int(in.Platform),
Tokens: in.Tokens, Tokens: in.Tokens,
@ -81,7 +81,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
} }
if in.Alert != nil { if in.Alert != nil {
notification.Alert = gorush.Alert{ notification.Alert = notify.Alert{
Title: in.Alert.Title, Title: in.Alert.Title,
Body: in.Alert.Body, Body: in.Alert.Body,
Subtitle: in.Alert.Subtitle, Subtitle: in.Alert.Subtitle,
@ -102,7 +102,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
} }
} }
go gorush.SendNotification(&notification) go notify.SendNotification(&notification)
return &proto.NotificationReply{ return &proto.NotificationReply{
Success: true, Success: true,