1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00
Manuel Imperiale 9972d1d1a4
MF-1240 - Return to service transport layer only service errors (#1559)
* MF-1240 - Return to service transport layer only service errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove unecessary errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated errors and fix transport

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert http endpoint_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix conflict

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-02-14 22:49:23 +01:00

32 lines
552 B
Go

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package api
import (
"net/http"
"github.com/mainflux/mainflux"
"github.com/mainflux/mainflux/readers"
)
var _ mainflux.Response = (*pageRes)(nil)
type pageRes struct {
readers.PageMetadata
Total uint64 `json:"total"`
Messages []readers.Message `json:"messages,omitempty"`
}
func (res pageRes) Headers() map[string]string {
return map[string]string{}
}
func (res pageRes) Code() int {
return http.StatusOK
}
func (res pageRes) Empty() bool {
return false
}