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>
19 lines
400 B
Go
19 lines
400 B
Go
package http
|
|
|
|
import "github.com/mainflux/mainflux/writer"
|
|
|
|
var _ Service = (*adapterService)(nil)
|
|
|
|
type adapterService struct {
|
|
mr writer.MessageRepository
|
|
}
|
|
|
|
// NewService instantiates the domain service implementation.
|
|
func NewService(mr writer.MessageRepository) Service {
|
|
return &adapterService{mr}
|
|
}
|
|
|
|
func (as *adapterService) Publish(msg writer.RawMessage) error {
|
|
return as.mr.Save(msg)
|
|
}
|