[#391] Refactor notifications

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-29 16:08:22 +03:00 committed by Alex Vanin
parent ea8e1b3b19
commit 94caa2247e
11 changed files with 279 additions and 278 deletions

View file

@ -8,6 +8,7 @@ import (
"time"
"github.com/nats-io/nats.go"
"github.com/nspcc-dev/neofs-s3-gw/api/handler"
"github.com/nspcc-dev/neofs-s3-gw/api/layer"
"go.uber.org/zap"
)
@ -179,7 +180,7 @@ func (c *Controller) Listen(ctx context.Context) {
}
}
func (c *Controller) SendNotifications(topics map[string]string, p *layer.SendNotificationParams) error {
func (c *Controller) SendNotifications(topics map[string]string, p *handler.SendNotificationParams) error {
event := prepareEvent(p)
for id, topic := range topics {
@ -214,7 +215,7 @@ func (c *Controller) SendTestNotification(topic, bucketName, requestID, HostID s
return c.publish(topic, msg)
}
func prepareEvent(p *layer.SendNotificationParams) *Event {
func prepareEvent(p *handler.SendNotificationParams) *Event {
return &Event{
Records: []EventRecord{
{