2017-01-01 21:39:05 +03:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/micro/go-micro/client"
|
|
|
|
)
|
|
|
|
|
2018-04-17 13:26:18 +03:00
|
|
|
type httpMessage struct {
|
2017-01-01 21:39:05 +03:00
|
|
|
topic string
|
|
|
|
contentType string
|
2018-04-17 13:26:18 +03:00
|
|
|
payload interface{}
|
2017-01-01 21:39:05 +03:00
|
|
|
}
|
|
|
|
|
2018-04-17 13:26:18 +03:00
|
|
|
func newHTTPMessage(topic string, payload interface{}, contentType string) client.Message {
|
|
|
|
return &httpMessage{
|
|
|
|
payload: payload,
|
2017-01-01 21:39:05 +03:00
|
|
|
topic: topic,
|
|
|
|
contentType: contentType,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-17 13:26:18 +03:00
|
|
|
func (h *httpMessage) ContentType() string {
|
2017-01-01 21:39:05 +03:00
|
|
|
return h.contentType
|
|
|
|
}
|
|
|
|
|
2018-04-17 13:26:18 +03:00
|
|
|
func (h *httpMessage) Topic() string {
|
2017-01-01 21:39:05 +03:00
|
|
|
return h.topic
|
|
|
|
}
|
|
|
|
|
2018-04-17 13:26:18 +03:00
|
|
|
func (h *httpMessage) Payload() interface{} {
|
|
|
|
return h.payload
|
2017-01-01 21:39:05 +03:00
|
|
|
}
|