Skip to content

Commit

Permalink
NOISSUE - Revert removal of notifier interface (absmach#2643)
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Gateru <[email protected]>
  • Loading branch information
felixgateru authored Jan 13, 2025
1 parent 6fd7e3d commit 3a11b54
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- "certs/pki/vault.go"
- "certs/service.go"
- "journal/journal.go"
- "consumers/notifier.go"
- name: Set up protoc
if: steps.changes.outputs.proto == 'true'
Expand Down Expand Up @@ -162,6 +163,7 @@ jobs:
mv ./pkg/events/mocks/publisher.go ./pkg/events/mocks/publisher.go.tmp
mv ./pkg/policies/mocks/evaluator.go ./pkg/policies/mocks/evaluator.go.tmp
mv ./pkg/policies/mocks/service.go ./pkg/policies/mocks/service.go.tmp
mv ./consumers/mocks/notifier.go ./consumers/mocks/notifier.go.tmp
make mocks
Expand Down Expand Up @@ -220,3 +222,4 @@ jobs:
check_mock_changes ./pkg/events/mocks/publisher.go " ./pkg/events/mocks/publisher.go"
check_mock_changes ./pkg/policies/mocks/evaluator.go " ./pkg/policies/mocks/evaluator.go"
check_mock_changes ./pkg/policies/mocks/service.go " ./pkg/policies/mocks/service.go"
check_mock_changes ./consumers/mocks/notifier.go " ./consumers/mocks/notifier.go"
47 changes: 47 additions & 0 deletions consumers/mocks/notifier.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions consumers/notifier.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package consumers

import (
"errors"

"github.com/absmach/supermq/pkg/messaging"
)

// ErrNotify wraps sending notification errors.
var ErrNotify = errors.New("error sending notification")

// Notifier represents an API for sending notification.
//
//go:generate mockery --name Notifier --output=./mocks --filename notifier.go --quiet --note "Copyright (c) Abstract Machines"
type Notifier interface {
// Notify method is used to send notification for the
// received message to the provided list of receivers.
Notify(from string, to []string, msg *messaging.Message) error
}

0 comments on commit 3a11b54

Please sign in to comment.