mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-29 13:49:28 +08:00

Simplified code where possible. Fixed golint suggestions regarding the missing godoc comments and unnecessary initialized variables. Signed-off-by: Dejan Mijic <dejan@mainflux.com>
18 lines
372 B
Go
18 lines
372 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-kit/kit/endpoint"
|
|
"github.com/mainflux/mainflux/http"
|
|
"github.com/mainflux/mainflux/writer"
|
|
)
|
|
|
|
func sendMessageEndpoint(svc http.Service) endpoint.Endpoint {
|
|
return func(_ context.Context, request interface{}) (interface{}, error) {
|
|
msg := request.(writer.RawMessage)
|
|
err := svc.Publish(msg)
|
|
return nil, err
|
|
}
|
|
}
|