Mainflux.mainflux/readers/messages.go

30 lines
775 B
Go
Raw Normal View History

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package readers
import (
"errors"
"github.com/mainflux/mainflux/pkg/transformers/senml"
)
// ErrNotFound indicates that requested entity doesn't exist.
var ErrNotFound = errors.New("entity not found")
// MessageRepository specifies message reader API.
type MessageRepository interface {
// ReadAll skips given number of messages for given channel and returns next
// limited number of messages.
ReadAll(chanID string, offset, limit uint64, query map[string]string) (MessagesPage, error)
}
// MessagesPage contains page related metadata as well as list of messages that
// belong to this page.
type MessagesPage struct {
Total uint64
Offset uint64
Limit uint64
MF-919 - Mainflux message updates (#924) * Remove RawMessage Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove Normalizer Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Replace normalizer with senml-transformer Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename Transformer interface and package Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove SenML transformer service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove SenML Protobuf support Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix readers Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix writers tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Refactor tests and remove normalizer Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Reanme Service interface to Transformer Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Use msg instead of rawmsg Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove rawMsg from Aedes code Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix VerneMQ files Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove RawMessage code Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix missing subtopic return Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove remaining RawMessage reference Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix formatting Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix readers and writers tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Rename SenML transformer variables Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix readers and writers tests constants Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-11-05 18:57:16 +08:00
Messages []senml.Message
}