Mainflux.mainflux/http/mocks/publisher.go

20 lines
377 B
Go
Raw Normal View History

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package mocks
2019-07-18 21:01:09 +08:00
import (
"github.com/mainflux/mainflux/pkg/messaging"
2019-07-18 21:01:09 +08:00
)
type mockPublisher struct{}
// NewPublisher returns mock message publisher.
NOISSUE - Refactor messaging (#1141) * Refactor messaging Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename SubscribeHandler to MessageHandler Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove `Auth` event logs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update message pubsub APi Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix topics handling Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update Twins service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update LoRa adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update OPC UA adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove broker package Package `broker` is conceptually renamed to package `nats`. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update makefile Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add comment explanation Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix MQTT adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typo Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Move NATS pub/sub implementation to pubsub pkg Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove an empty line in main methods Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Move messaging-related code to messaging package Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix Twins mocks Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Change Occurred back to Created Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix tranformer test Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix message proto commands Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Replace string literal with constant Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove alias from main method Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Change messaging pubsub alias Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename occured to created Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Handle NATS connection in the NATS PubSub Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename n to pub/pubSub Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typos Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-28 17:02:35 +08:00
func NewPublisher() messaging.Publisher {
return mockPublisher{}
}
NOISSUE - Refactor messaging (#1141) * Refactor messaging Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename SubscribeHandler to MessageHandler Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove `Auth` event logs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update message pubsub APi Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix topics handling Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update Twins service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update LoRa adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update OPC UA adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove broker package Package `broker` is conceptually renamed to package `nats`. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update makefile Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add comment explanation Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix MQTT adapter Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typo Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Move NATS pub/sub implementation to pubsub pkg Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove an empty line in main methods Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Move messaging-related code to messaging package Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix Twins mocks Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Change Occurred back to Created Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix tranformer test Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix message proto commands Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Replace string literal with constant Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove alias from main method Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Change messaging pubsub alias Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename occured to created Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Handle NATS connection in the NATS PubSub Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename n to pub/pubSub Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typos Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-28 17:02:35 +08:00
func (pub mockPublisher) Publish(topic string, msg messaging.Message) error {
return nil
}