23 lines
366 B
Go
23 lines
366 B
Go
// Copyright (c) Mainflux
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package api
|
|
|
|
import (
|
|
"github.com/mainflux/mainflux/internal/apiutil"
|
|
"github.com/mainflux/mainflux/pkg/messaging"
|
|
)
|
|
|
|
type publishReq struct {
|
|
msg messaging.Message
|
|
token string
|
|
}
|
|
|
|
func (req publishReq) validate() error {
|
|
if req.token == "" {
|
|
return apiutil.ErrBearerToken
|
|
}
|
|
|
|
return nil
|
|
}
|