mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-04 22:17:59 +08:00

* 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>
44 lines
663 B
Go
44 lines
663 B
Go
package policies
|
|
|
|
import "net/http"
|
|
|
|
type createPolicyRes struct {
|
|
created bool
|
|
}
|
|
|
|
func (res createPolicyRes) Code() int {
|
|
if res.created {
|
|
return http.StatusCreated
|
|
}
|
|
|
|
return http.StatusOK
|
|
}
|
|
|
|
func (res createPolicyRes) Headers() map[string]string {
|
|
return map[string]string{}
|
|
}
|
|
|
|
func (res createPolicyRes) Empty() bool {
|
|
return false
|
|
}
|
|
|
|
type deletePoliciesRes struct {
|
|
deleted bool
|
|
}
|
|
|
|
func (res deletePoliciesRes) Code() int {
|
|
if res.deleted {
|
|
return http.StatusNoContent
|
|
}
|
|
|
|
return http.StatusOK
|
|
}
|
|
|
|
func (res deletePoliciesRes) Headers() map[string]string {
|
|
return map[string]string{}
|
|
}
|
|
|
|
func (res deletePoliciesRes) Empty() bool {
|
|
return true
|
|
}
|