🎉 Initial Commit
This commit is contained in:
36
pkg/internal/grpc/pusher.go
Normal file
36
pkg/internal/grpc/pusher.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/internal/provider"
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/proto"
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/pushkit"
|
||||
)
|
||||
|
||||
func (v *Server) PushNotification(ctx context.Context, request *proto.PushNotificationRequest) (*proto.DeliveryResponse, error) {
|
||||
err := provider.PushNotification(pushkit.NotificationPushRequest{
|
||||
Provider: request.GetProvider(),
|
||||
Token: request.GetDeviceToken(),
|
||||
Notification: pushkit.NewNotificationFromProto(request.GetNotify()),
|
||||
})
|
||||
return &proto.DeliveryResponse{IsSuccess: err == nil}, nil
|
||||
}
|
||||
|
||||
func (v *Server) PushNotificationBatch(ctx context.Context, request *proto.PushNotificationBatchRequest) (*proto.DeliveryResponse, error) {
|
||||
go provider.PushNotificationBatch(pushkit.NotificationPushBatchRequest{
|
||||
Providers: request.GetProviders(),
|
||||
Tokens: request.GetDeviceTokens(),
|
||||
Notification: pushkit.NewNotificationFromProto(request.GetNotify()),
|
||||
})
|
||||
return &proto.DeliveryResponse{IsSuccess: true}, nil
|
||||
}
|
||||
|
||||
func (v *Server) DeliverEmail(ctx context.Context, request *proto.DeliverEmailRequest) (*proto.DeliveryResponse, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (v *Server) DeliverEmailBatch(ctx context.Context, request *proto.DeliverEmailBatchRequest) (*proto.DeliveryResponse, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
Reference in New Issue
Block a user