Merge pull request #158 from bblagojevic94/mainflux-157
Export normalize method from writer service inside cassandra package
This commit is contained in:
commit
6d9c92596c
|
@ -17,7 +17,9 @@ func NewMessageRepository(session *gocql.Session) writer.MessageRepository {
|
|||
return &msgRepository{session}
|
||||
}
|
||||
|
||||
func normalize(msg writer.RawMessage) ([]writer.Message, error) {
|
||||
// Normalize decodes and normalizes message emitted by the mainflux adapters layer
|
||||
// into Message structure. A non-nil error is returned to indicate operation failure.
|
||||
func Normalize(msg writer.RawMessage) ([]writer.Message, error) {
|
||||
var (
|
||||
rm, nm senml.SenML // raw and normalized message
|
||||
err error
|
||||
|
@ -68,7 +70,7 @@ func (repo *msgRepository) Save(raw writer.RawMessage) error {
|
|||
err error
|
||||
)
|
||||
|
||||
if msgs, err = normalize(raw); err != nil {
|
||||
if msgs, err = Normalize(raw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue