From 1fa56b20d7e9027952d9648adbb6a4fe1d6c941c Mon Sep 17 00:00:00 2001 From: Dmitry Redkin Date: Fri, 18 Nov 2022 10:00:50 +0500 Subject: [PATCH] refactor: Move pkg Moved senders directory to notifier directory, because senders have no sense without notifier, senders is a part of notifier. Also resolve some warnings --- notifier/registrator.go | 30 +++++++++---------- .../senders}/calc_message_parts.go | 0 .../senders}/calc_message_parts_test.go | 0 .../senders}/discord/response.go | 0 .../senders}/discord/response_test.go | 0 {senders => notifier/senders}/discord/send.go | 2 +- .../senders}/discord/send_test.go | 0 .../senders}/discord/sender.go | 0 .../senders}/discord/sender_test.go | 0 {senders => notifier/senders}/mail/mail.go | 0 .../senders}/mail/mail_test.go | 0 {senders => notifier/senders}/mail/send.go | 0 .../senders}/mail/send_test.go | 4 +-- .../senders}/mail/template.go | 0 .../senders}/mattermost/client.go | 0 .../senders}/mattermost/doc.go | 0 .../senders}/mattermost/sender.go | 2 +- .../mattermost/sender_internal_test.go | 0 .../senders}/mattermost/sender_manual_test.go | 2 +- .../senders}/mattermost/sender_test.go | 2 +- .../senders}/msteams/datatypes.go | 0 .../senders}/msteams/msteams.go | 0 .../senders}/msteams/msteams_test.go | 0 .../senders}/opsgenie/send.go | 5 ++-- .../senders}/opsgenie/send_test.go | 0 .../senders}/opsgenie/sender.go | 3 +- .../senders}/opsgenie/sender_test.go | 0 .../senders}/pagerduty/send.go | 0 .../senders}/pagerduty/send_test.go | 0 .../senders}/pagerduty/sender.go | 2 +- .../senders}/pagerduty/sender_test.go | 0 .../senders}/pushover/pushover.go | 0 .../senders}/pushover/pushover_test.go | 0 .../senders}/read_image_store_config.go | 0 .../senders}/read_image_store_config_test.go | 0 .../senders}/script/script.go | 0 .../senders}/script/script_test.go | 0 .../senders}/selfstate/selfstate.go | 0 .../senders}/selfstate/selfstate_test.go | 0 {senders => notifier/senders}/slack/slack.go | 6 ++-- .../senders}/slack/slack_test.go | 0 .../senders}/telegram/handle_message.go | 0 .../senders}/telegram/handle_message_test.go | 0 .../senders}/telegram/send.go | 0 .../senders}/telegram/send_test.go | 0 .../senders}/telegram/sender.go | 0 .../senders}/telegram/sender_test.go | 2 +- {senders => notifier/senders}/twilio/sms.go | 2 +- .../senders}/twilio/sms_test.go | 0 .../senders}/twilio/twilio.go | 0 .../senders}/twilio/twilio_test.go | 0 {senders => notifier/senders}/twilio/voice.go | 2 +- .../senders}/twilio/voice_test.go | 0 .../senders}/victorops/api/alert.go | 0 .../senders}/victorops/api/alert_test.go | 0 .../senders}/victorops/api/client.go | 0 .../senders}/victorops/api/client_test.go | 0 .../senders}/victorops/send.go | 2 +- .../senders}/victorops/send_test.go | 6 ++-- .../senders}/victorops/sender.go | 3 +- .../senders}/victorops/sender_test.go | 2 +- .../senders}/webhook/payload.go | 0 .../senders}/webhook/request.go | 0 .../senders}/webhook/request_test.go | 0 .../senders}/webhook/webhook.go | 0 .../senders}/webhook/webhook_test.go | 0 66 files changed, 39 insertions(+), 38 deletions(-) rename {senders => notifier/senders}/calc_message_parts.go (100%) rename {senders => notifier/senders}/calc_message_parts_test.go (100%) rename {senders => notifier/senders}/discord/response.go (100%) rename {senders => notifier/senders}/discord/response_test.go (100%) rename {senders => notifier/senders}/discord/send.go (98%) rename {senders => notifier/senders}/discord/send_test.go (100%) rename {senders => notifier/senders}/discord/sender.go (100%) rename {senders => notifier/senders}/discord/sender_test.go (100%) rename {senders => notifier/senders}/mail/mail.go (100%) rename {senders => notifier/senders}/mail/mail_test.go (100%) rename {senders => notifier/senders}/mail/send.go (100%) rename {senders => notifier/senders}/mail/send_test.go (96%) rename {senders => notifier/senders}/mail/template.go (100%) rename {senders => notifier/senders}/mattermost/client.go (100%) rename {senders => notifier/senders}/mattermost/doc.go (100%) rename {senders => notifier/senders}/mattermost/sender.go (99%) rename {senders => notifier/senders}/mattermost/sender_internal_test.go (100%) rename {senders => notifier/senders}/mattermost/sender_manual_test.go (95%) rename {senders => notifier/senders}/mattermost/sender_test.go (96%) rename {senders => notifier/senders}/msteams/datatypes.go (100%) rename {senders => notifier/senders}/msteams/msteams.go (100%) rename {senders => notifier/senders}/msteams/msteams_test.go (100%) rename {senders => notifier/senders}/opsgenie/send.go (98%) rename {senders => notifier/senders}/opsgenie/send_test.go (100%) rename {senders => notifier/senders}/opsgenie/sender.go (96%) rename {senders => notifier/senders}/opsgenie/sender_test.go (100%) rename {senders => notifier/senders}/pagerduty/send.go (100%) rename {senders => notifier/senders}/pagerduty/send_test.go (100%) rename {senders => notifier/senders}/pagerduty/sender.go (95%) rename {senders => notifier/senders}/pagerduty/sender_test.go (100%) rename {senders => notifier/senders}/pushover/pushover.go (100%) rename {senders => notifier/senders}/pushover/pushover_test.go (100%) rename {senders => notifier/senders}/read_image_store_config.go (100%) rename {senders => notifier/senders}/read_image_store_config_test.go (100%) rename {senders => notifier/senders}/script/script.go (100%) rename {senders => notifier/senders}/script/script_test.go (100%) rename {senders => notifier/senders}/selfstate/selfstate.go (100%) rename {senders => notifier/senders}/selfstate/selfstate_test.go (100%) rename {senders => notifier/senders}/slack/slack.go (98%) rename {senders => notifier/senders}/slack/slack_test.go (100%) rename {senders => notifier/senders}/telegram/handle_message.go (100%) rename {senders => notifier/senders}/telegram/handle_message_test.go (100%) rename {senders => notifier/senders}/telegram/send.go (100%) rename {senders => notifier/senders}/telegram/send_test.go (100%) rename {senders => notifier/senders}/telegram/sender.go (100%) rename {senders => notifier/senders}/telegram/sender_test.go (93%) rename {senders => notifier/senders}/twilio/sms.go (97%) rename {senders => notifier/senders}/twilio/sms_test.go (100%) rename {senders => notifier/senders}/twilio/twilio.go (100%) rename {senders => notifier/senders}/twilio/twilio_test.go (100%) rename {senders => notifier/senders}/twilio/voice.go (87%) rename {senders => notifier/senders}/twilio/voice_test.go (100%) rename {senders => notifier/senders}/victorops/api/alert.go (100%) rename {senders => notifier/senders}/victorops/api/alert_test.go (100%) rename {senders => notifier/senders}/victorops/api/client.go (100%) rename {senders => notifier/senders}/victorops/api/client_test.go (100%) rename {senders => notifier/senders}/victorops/send.go (98%) rename {senders => notifier/senders}/victorops/send_test.go (98%) rename {senders => notifier/senders}/victorops/sender.go (96%) rename {senders => notifier/senders}/victorops/sender_test.go (97%) rename {senders => notifier/senders}/webhook/payload.go (100%) rename {senders => notifier/senders}/webhook/request.go (100%) rename {senders => notifier/senders}/webhook/request_test.go (100%) rename {senders => notifier/senders}/webhook/webhook.go (100%) rename {senders => notifier/senders}/webhook/webhook_test.go (100%) diff --git a/notifier/registrator.go b/notifier/registrator.go index fac5e09a9..84ac64ef1 100644 --- a/notifier/registrator.go +++ b/notifier/registrator.go @@ -5,21 +5,21 @@ import ( "strings" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders/discord" - "github.com/moira-alert/moira/senders/mail" - "github.com/moira-alert/moira/senders/mattermost" - "github.com/moira-alert/moira/senders/msteams" - "github.com/moira-alert/moira/senders/opsgenie" - "github.com/moira-alert/moira/senders/pagerduty" - "github.com/moira-alert/moira/senders/pushover" - "github.com/moira-alert/moira/senders/script" - "github.com/moira-alert/moira/senders/selfstate" - "github.com/moira-alert/moira/senders/slack" - "github.com/moira-alert/moira/senders/telegram" - "github.com/moira-alert/moira/senders/twilio" - "github.com/moira-alert/moira/senders/victorops" - "github.com/moira-alert/moira/senders/webhook" - // "github.com/moira-alert/moira/senders/kontur" + "github.com/moira-alert/moira/notifier/senders/discord" + "github.com/moira-alert/moira/notifier/senders/mail" + "github.com/moira-alert/moira/notifier/senders/mattermost" + "github.com/moira-alert/moira/notifier/senders/msteams" + "github.com/moira-alert/moira/notifier/senders/opsgenie" + "github.com/moira-alert/moira/notifier/senders/pagerduty" + "github.com/moira-alert/moira/notifier/senders/pushover" + "github.com/moira-alert/moira/notifier/senders/script" + "github.com/moira-alert/moira/notifier/senders/selfstate" + "github.com/moira-alert/moira/notifier/senders/slack" + "github.com/moira-alert/moira/notifier/senders/telegram" + "github.com/moira-alert/moira/notifier/senders/twilio" + "github.com/moira-alert/moira/notifier/senders/victorops" + "github.com/moira-alert/moira/notifier/senders/webhook" + // "github.com/moira-alert/moira/notifier/senders/kontur" ) const ( diff --git a/senders/calc_message_parts.go b/notifier/senders/calc_message_parts.go similarity index 100% rename from senders/calc_message_parts.go rename to notifier/senders/calc_message_parts.go diff --git a/senders/calc_message_parts_test.go b/notifier/senders/calc_message_parts_test.go similarity index 100% rename from senders/calc_message_parts_test.go rename to notifier/senders/calc_message_parts_test.go diff --git a/senders/discord/response.go b/notifier/senders/discord/response.go similarity index 100% rename from senders/discord/response.go rename to notifier/senders/discord/response.go diff --git a/senders/discord/response_test.go b/notifier/senders/discord/response_test.go similarity index 100% rename from senders/discord/response_test.go rename to notifier/senders/discord/response_test.go diff --git a/senders/discord/send.go b/notifier/senders/discord/send.go similarity index 98% rename from senders/discord/send.go rename to notifier/senders/discord/send.go index f2fb34ebb..68a52f493 100644 --- a/senders/discord/send.go +++ b/notifier/senders/discord/send.go @@ -9,7 +9,7 @@ import ( "github.com/bwmarrin/discordgo" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" + "github.com/moira-alert/moira/notifier/senders" ) const ( diff --git a/senders/discord/send_test.go b/notifier/senders/discord/send_test.go similarity index 100% rename from senders/discord/send_test.go rename to notifier/senders/discord/send_test.go diff --git a/senders/discord/sender.go b/notifier/senders/discord/sender.go similarity index 100% rename from senders/discord/sender.go rename to notifier/senders/discord/sender.go diff --git a/senders/discord/sender_test.go b/notifier/senders/discord/sender_test.go similarity index 100% rename from senders/discord/sender_test.go rename to notifier/senders/discord/sender_test.go diff --git a/senders/mail/mail.go b/notifier/senders/mail/mail.go similarity index 100% rename from senders/mail/mail.go rename to notifier/senders/mail/mail.go diff --git a/senders/mail/mail_test.go b/notifier/senders/mail/mail_test.go similarity index 100% rename from senders/mail/mail_test.go rename to notifier/senders/mail/mail_test.go diff --git a/senders/mail/send.go b/notifier/senders/mail/send.go similarity index 100% rename from senders/mail/send.go rename to notifier/senders/mail/send.go diff --git a/senders/mail/send_test.go b/notifier/senders/mail/send_test.go similarity index 96% rename from senders/mail/send_test.go rename to notifier/senders/mail/send_test.go index d14a43000..2049ad001 100644 --- a/senders/mail/send_test.go +++ b/notifier/senders/mail/send_test.go @@ -48,7 +48,7 @@ some other text _italics text_`, } Convey("Make message", t, func() { - message := sender.makeMessage(generateTestEvents(10, trigger.ID), contact, trigger, [][]byte{[]byte{1, 0, 1}}, true) //nolint + message := sender.makeMessage(generateTestEvents(10, trigger.ID), contact, trigger, [][]byte{{1, 0, 1}}, true) So(message.GetHeader("From")[0], ShouldEqual, sender.From) So(message.GetHeader("To")[0], ShouldEqual, contact.Value) @@ -107,7 +107,7 @@ func TestEmptyTriggerID(t *testing.T) { } Convey("Make message", t, func() { - message := sender.makeMessage(generateTestEvents(10, trigger.ID), contact, trigger, [][]byte{[]byte{1, 0, 1}}, true) //nolint + message := sender.makeMessage(generateTestEvents(10, trigger.ID), contact, trigger, [][]byte{{1, 0, 1}}, true) So(message.GetHeader("From")[0], ShouldEqual, sender.From) So(message.GetHeader("To")[0], ShouldEqual, contact.Value) messageStr := new(bytes.Buffer) diff --git a/senders/mail/template.go b/notifier/senders/mail/template.go similarity index 100% rename from senders/mail/template.go rename to notifier/senders/mail/template.go diff --git a/senders/mattermost/client.go b/notifier/senders/mattermost/client.go similarity index 100% rename from senders/mattermost/client.go rename to notifier/senders/mattermost/client.go diff --git a/senders/mattermost/doc.go b/notifier/senders/mattermost/doc.go similarity index 100% rename from senders/mattermost/doc.go rename to notifier/senders/mattermost/doc.go diff --git a/senders/mattermost/sender.go b/notifier/senders/mattermost/sender.go similarity index 99% rename from senders/mattermost/sender.go rename to notifier/senders/mattermost/sender.go index bc672d6be..c8331a3a1 100644 --- a/senders/mattermost/sender.go +++ b/notifier/senders/mattermost/sender.go @@ -9,7 +9,7 @@ import ( "time" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" + "github.com/moira-alert/moira/notifier/senders" "github.com/mattermost/mattermost-server/v6/model" ) diff --git a/senders/mattermost/sender_internal_test.go b/notifier/senders/mattermost/sender_internal_test.go similarity index 100% rename from senders/mattermost/sender_internal_test.go rename to notifier/senders/mattermost/sender_internal_test.go diff --git a/senders/mattermost/sender_manual_test.go b/notifier/senders/mattermost/sender_manual_test.go similarity index 95% rename from senders/mattermost/sender_manual_test.go rename to notifier/senders/mattermost/sender_manual_test.go index bf59ef657..dd73787a1 100644 --- a/senders/mattermost/sender_manual_test.go +++ b/notifier/senders/mattermost/sender_manual_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders/mattermost" + "github.com/moira-alert/moira/notifier/senders/mattermost" . "github.com/smartystreets/goconvey/convey" ) diff --git a/senders/mattermost/sender_test.go b/notifier/senders/mattermost/sender_test.go similarity index 96% rename from senders/mattermost/sender_test.go rename to notifier/senders/mattermost/sender_test.go index 216efcd4b..4cbf21754 100644 --- a/senders/mattermost/sender_test.go +++ b/notifier/senders/mattermost/sender_test.go @@ -3,7 +3,7 @@ package mattermost_test import ( "testing" - "github.com/moira-alert/moira/senders/mattermost" + "github.com/moira-alert/moira/notifier/senders/mattermost" . "github.com/smartystreets/goconvey/convey" ) diff --git a/senders/msteams/datatypes.go b/notifier/senders/msteams/datatypes.go similarity index 100% rename from senders/msteams/datatypes.go rename to notifier/senders/msteams/datatypes.go diff --git a/senders/msteams/msteams.go b/notifier/senders/msteams/msteams.go similarity index 100% rename from senders/msteams/msteams.go rename to notifier/senders/msteams/msteams.go diff --git a/senders/msteams/msteams_test.go b/notifier/senders/msteams/msteams_test.go similarity index 100% rename from senders/msteams/msteams_test.go rename to notifier/senders/msteams/msteams_test.go diff --git a/senders/opsgenie/send.go b/notifier/senders/opsgenie/send.go similarity index 98% rename from senders/opsgenie/send.go rename to notifier/senders/opsgenie/send.go index d078c9862..4cd1982e0 100644 --- a/senders/opsgenie/send.go +++ b/notifier/senders/opsgenie/send.go @@ -7,9 +7,10 @@ import ( "strings" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" + "github.com/moira-alert/moira/notifier/senders" + "github.com/opsgenie/opsgenie-go-sdk-v2/alert" - blackfriday "github.com/russross/blackfriday/v2" + "github.com/russross/blackfriday/v2" ) const ( diff --git a/senders/opsgenie/send_test.go b/notifier/senders/opsgenie/send_test.go similarity index 100% rename from senders/opsgenie/send_test.go rename to notifier/senders/opsgenie/send_test.go diff --git a/senders/opsgenie/sender.go b/notifier/senders/opsgenie/sender.go similarity index 96% rename from senders/opsgenie/sender.go rename to notifier/senders/opsgenie/sender.go index 3e81a8cd2..5c5908b3a 100644 --- a/senders/opsgenie/sender.go +++ b/notifier/senders/opsgenie/sender.go @@ -5,7 +5,8 @@ import ( "time" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" + "github.com/moira-alert/moira/notifier/senders" + "github.com/opsgenie/opsgenie-go-sdk-v2/alert" "github.com/opsgenie/opsgenie-go-sdk-v2/client" ) diff --git a/senders/opsgenie/sender_test.go b/notifier/senders/opsgenie/sender_test.go similarity index 100% rename from senders/opsgenie/sender_test.go rename to notifier/senders/opsgenie/sender_test.go diff --git a/senders/pagerduty/send.go b/notifier/senders/pagerduty/send.go similarity index 100% rename from senders/pagerduty/send.go rename to notifier/senders/pagerduty/send.go diff --git a/senders/pagerduty/send_test.go b/notifier/senders/pagerduty/send_test.go similarity index 100% rename from senders/pagerduty/send_test.go rename to notifier/senders/pagerduty/send_test.go diff --git a/senders/pagerduty/sender.go b/notifier/senders/pagerduty/sender.go similarity index 95% rename from senders/pagerduty/sender.go rename to notifier/senders/pagerduty/sender.go index 21819fb80..84b483f8f 100644 --- a/senders/pagerduty/sender.go +++ b/notifier/senders/pagerduty/sender.go @@ -4,7 +4,7 @@ import ( "time" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" + "github.com/moira-alert/moira/notifier/senders" ) // Sender implements moira sender interface for PagerDuty. diff --git a/senders/pagerduty/sender_test.go b/notifier/senders/pagerduty/sender_test.go similarity index 100% rename from senders/pagerduty/sender_test.go rename to notifier/senders/pagerduty/sender_test.go diff --git a/senders/pushover/pushover.go b/notifier/senders/pushover/pushover.go similarity index 100% rename from senders/pushover/pushover.go rename to notifier/senders/pushover/pushover.go diff --git a/senders/pushover/pushover_test.go b/notifier/senders/pushover/pushover_test.go similarity index 100% rename from senders/pushover/pushover_test.go rename to notifier/senders/pushover/pushover_test.go diff --git a/senders/read_image_store_config.go b/notifier/senders/read_image_store_config.go similarity index 100% rename from senders/read_image_store_config.go rename to notifier/senders/read_image_store_config.go diff --git a/senders/read_image_store_config_test.go b/notifier/senders/read_image_store_config_test.go similarity index 100% rename from senders/read_image_store_config_test.go rename to notifier/senders/read_image_store_config_test.go diff --git a/senders/script/script.go b/notifier/senders/script/script.go similarity index 100% rename from senders/script/script.go rename to notifier/senders/script/script.go diff --git a/senders/script/script_test.go b/notifier/senders/script/script_test.go similarity index 100% rename from senders/script/script_test.go rename to notifier/senders/script/script_test.go diff --git a/senders/selfstate/selfstate.go b/notifier/senders/selfstate/selfstate.go similarity index 100% rename from senders/selfstate/selfstate.go rename to notifier/senders/selfstate/selfstate.go diff --git a/senders/selfstate/selfstate_test.go b/notifier/senders/selfstate/selfstate_test.go similarity index 100% rename from senders/selfstate/selfstate_test.go rename to notifier/senders/selfstate/selfstate_test.go diff --git a/senders/slack/slack.go b/notifier/senders/slack/slack.go similarity index 98% rename from senders/slack/slack.go rename to notifier/senders/slack/slack.go index d270dca55..44d610e2b 100644 --- a/senders/slack/slack.go +++ b/notifier/senders/slack/slack.go @@ -7,11 +7,11 @@ import ( "strings" "time" - slackdown "github.com/karriereat/blackfriday-slack" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders" - blackfriday "github.com/russross/blackfriday/v2" + "github.com/moira-alert/moira/notifier/senders" + slackdown "github.com/karriereat/blackfriday-slack" + "github.com/russross/blackfriday/v2" "github.com/slack-go/slack" ) diff --git a/senders/slack/slack_test.go b/notifier/senders/slack/slack_test.go similarity index 100% rename from senders/slack/slack_test.go rename to notifier/senders/slack/slack_test.go diff --git a/senders/telegram/handle_message.go b/notifier/senders/telegram/handle_message.go similarity index 100% rename from senders/telegram/handle_message.go rename to notifier/senders/telegram/handle_message.go diff --git a/senders/telegram/handle_message_test.go b/notifier/senders/telegram/handle_message_test.go similarity index 100% rename from senders/telegram/handle_message_test.go rename to notifier/senders/telegram/handle_message_test.go diff --git a/senders/telegram/send.go b/notifier/senders/telegram/send.go similarity index 100% rename from senders/telegram/send.go rename to notifier/senders/telegram/send.go diff --git a/senders/telegram/send_test.go b/notifier/senders/telegram/send_test.go similarity index 100% rename from senders/telegram/send_test.go rename to notifier/senders/telegram/send_test.go diff --git a/senders/telegram/sender.go b/notifier/senders/telegram/sender.go similarity index 100% rename from senders/telegram/sender.go rename to notifier/senders/telegram/sender.go diff --git a/senders/telegram/sender_test.go b/notifier/senders/telegram/sender_test.go similarity index 93% rename from senders/telegram/sender_test.go rename to notifier/senders/telegram/sender_test.go index fb1241edd..84a83b47c 100644 --- a/senders/telegram/sender_test.go +++ b/notifier/senders/telegram/sender_test.go @@ -6,7 +6,7 @@ import ( "time" logging "github.com/moira-alert/moira/logging/zerolog_adapter" - "github.com/moira-alert/moira/senders/telegram" + "github.com/moira-alert/moira/notifier/senders/telegram" . "github.com/smartystreets/goconvey/convey" ) diff --git a/senders/twilio/sms.go b/notifier/senders/twilio/sms.go similarity index 97% rename from senders/twilio/sms.go rename to notifier/senders/twilio/sms.go index b25ab0709..8a4b3772e 100644 --- a/senders/twilio/sms.go +++ b/notifier/senders/twilio/sms.go @@ -14,7 +14,7 @@ type twilioSenderSms struct { twilioSender } -func (sender *twilioSenderSms) SendEvents(events moira.NotificationEvents, contact moira.ContactData, trigger moira.TriggerData, plots [][]byte, throttled bool) error { +func (sender *twilioSenderSms) SendEvents(events moira.NotificationEvents, contact moira.ContactData, trigger moira.TriggerData, _ [][]byte, throttled bool) error { message := sender.buildMessage(events, trigger, throttled) sender.logger.Debugf("Calling twilio sms api to phone %s and message body %s", contact.Value, message) twilioMessage, err := twilio.NewMessage(sender.client, sender.APIFromPhone, contact.Value, twilio.Body(message)) diff --git a/senders/twilio/sms_test.go b/notifier/senders/twilio/sms_test.go similarity index 100% rename from senders/twilio/sms_test.go rename to notifier/senders/twilio/sms_test.go diff --git a/senders/twilio/twilio.go b/notifier/senders/twilio/twilio.go similarity index 100% rename from senders/twilio/twilio.go rename to notifier/senders/twilio/twilio.go diff --git a/senders/twilio/twilio_test.go b/notifier/senders/twilio/twilio_test.go similarity index 100% rename from senders/twilio/twilio_test.go rename to notifier/senders/twilio/twilio_test.go diff --git a/senders/twilio/voice.go b/notifier/senders/twilio/voice.go similarity index 87% rename from senders/twilio/voice.go rename to notifier/senders/twilio/voice.go index 116d9d569..9f7483936 100644 --- a/senders/twilio/voice.go +++ b/notifier/senders/twilio/voice.go @@ -17,7 +17,7 @@ type twilioSenderVoice struct { twimletsEcho bool } -func (sender *twilioSenderVoice) SendEvents(events moira.NotificationEvents, contact moira.ContactData, trigger moira.TriggerData, plots [][]byte, throttled bool) error { +func (sender *twilioSenderVoice) SendEvents(_ moira.NotificationEvents, contact moira.ContactData, trigger moira.TriggerData, _ [][]byte, _ bool) error { voiceURL := sender.buildVoiceURL(trigger) twilioCall, err := twilio.NewCall(sender.client, sender.APIFromPhone, contact.Value, twilio.Callback(voiceURL)) if err != nil { diff --git a/senders/twilio/voice_test.go b/notifier/senders/twilio/voice_test.go similarity index 100% rename from senders/twilio/voice_test.go rename to notifier/senders/twilio/voice_test.go diff --git a/senders/victorops/api/alert.go b/notifier/senders/victorops/api/alert.go similarity index 100% rename from senders/victorops/api/alert.go rename to notifier/senders/victorops/api/alert.go diff --git a/senders/victorops/api/alert_test.go b/notifier/senders/victorops/api/alert_test.go similarity index 100% rename from senders/victorops/api/alert_test.go rename to notifier/senders/victorops/api/alert_test.go diff --git a/senders/victorops/api/client.go b/notifier/senders/victorops/api/client.go similarity index 100% rename from senders/victorops/api/client.go rename to notifier/senders/victorops/api/client.go diff --git a/senders/victorops/api/client_test.go b/notifier/senders/victorops/api/client_test.go similarity index 100% rename from senders/victorops/api/client_test.go rename to notifier/senders/victorops/api/client_test.go diff --git a/senders/victorops/send.go b/notifier/senders/victorops/send.go similarity index 98% rename from senders/victorops/send.go rename to notifier/senders/victorops/send.go index 85c9b1cc2..bc420474c 100644 --- a/senders/victorops/send.go +++ b/notifier/senders/victorops/send.go @@ -8,7 +8,7 @@ import ( stripmd "github.com/writeas/go-strip-markdown" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders/victorops/api" + "github.com/moira-alert/moira/notifier/senders/victorops/api" ) // SendEvents implements Sender interface Send diff --git a/senders/victorops/send_test.go b/notifier/senders/victorops/send_test.go similarity index 98% rename from senders/victorops/send_test.go rename to notifier/senders/victorops/send_test.go index d2fb0e857..25b3a4570 100644 --- a/senders/victorops/send_test.go +++ b/notifier/senders/victorops/send_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" - "github.com/moira-alert/moira/senders/victorops/api" - "github.com/moira-alert/moira" mock_moira_alert "github.com/moira-alert/moira/mock/moira-alert" + "github.com/moira-alert/moira/notifier/senders/victorops/api" + + "github.com/golang/mock/gomock" . "github.com/smartystreets/goconvey/convey" ) diff --git a/senders/victorops/sender.go b/notifier/senders/victorops/sender.go similarity index 96% rename from senders/victorops/sender.go rename to notifier/senders/victorops/sender.go index 101856c14..48e65d7a4 100644 --- a/senders/victorops/sender.go +++ b/notifier/senders/victorops/sender.go @@ -4,9 +4,8 @@ import ( "fmt" "time" - "github.com/moira-alert/moira/senders/victorops/api" - "github.com/moira-alert/moira" + "github.com/moira-alert/moira/notifier/senders/victorops/api" ) // Sender implements moira sender interface for VictorOps. diff --git a/senders/victorops/sender_test.go b/notifier/senders/victorops/sender_test.go similarity index 97% rename from senders/victorops/sender_test.go rename to notifier/senders/victorops/sender_test.go index 6a0b7de79..a36f2d5a2 100644 --- a/senders/victorops/sender_test.go +++ b/notifier/senders/victorops/sender_test.go @@ -7,7 +7,7 @@ import ( "github.com/golang/mock/gomock" "github.com/moira-alert/moira" - "github.com/moira-alert/moira/senders/victorops/api" + "github.com/moira-alert/moira/notifier/senders/victorops/api" logging "github.com/moira-alert/moira/logging/zerolog_adapter" mock_moira_alert "github.com/moira-alert/moira/mock/moira-alert" diff --git a/senders/webhook/payload.go b/notifier/senders/webhook/payload.go similarity index 100% rename from senders/webhook/payload.go rename to notifier/senders/webhook/payload.go diff --git a/senders/webhook/request.go b/notifier/senders/webhook/request.go similarity index 100% rename from senders/webhook/request.go rename to notifier/senders/webhook/request.go diff --git a/senders/webhook/request_test.go b/notifier/senders/webhook/request_test.go similarity index 100% rename from senders/webhook/request_test.go rename to notifier/senders/webhook/request_test.go diff --git a/senders/webhook/webhook.go b/notifier/senders/webhook/webhook.go similarity index 100% rename from senders/webhook/webhook.go rename to notifier/senders/webhook/webhook.go diff --git a/senders/webhook/webhook_test.go b/notifier/senders/webhook/webhook_test.go similarity index 100% rename from senders/webhook/webhook_test.go rename to notifier/senders/webhook/webhook_test.go