2018-12-19 10:33:23 +03:00
|
|
|
package http
|
|
|
|
|
2020-11-18 13:08:50 +03:00
|
|
|
import (
|
|
|
|
"github.com/unistack-org/micro/v3/codec"
|
|
|
|
"github.com/unistack-org/micro/v3/metadata"
|
|
|
|
)
|
2020-10-10 00:38:35 +03:00
|
|
|
|
2018-12-19 12:47:03 +03:00
|
|
|
type httpMessage struct {
|
2018-12-19 10:33:23 +03:00
|
|
|
payload interface{}
|
2021-04-25 12:02:18 +03:00
|
|
|
codec codec.Codec
|
2020-11-18 13:08:50 +03:00
|
|
|
header metadata.Metadata
|
2021-04-25 12:02:18 +03:00
|
|
|
topic string
|
|
|
|
contentType string
|
2020-10-10 00:38:35 +03:00
|
|
|
body []byte
|
2018-12-19 10:33:23 +03:00
|
|
|
}
|
|
|
|
|
2018-12-19 12:47:03 +03:00
|
|
|
func (r *httpMessage) Topic() string {
|
2018-12-19 10:33:23 +03:00
|
|
|
return r.topic
|
|
|
|
}
|
|
|
|
|
2018-12-19 12:47:03 +03:00
|
|
|
func (r *httpMessage) Payload() interface{} {
|
2018-12-19 10:33:23 +03:00
|
|
|
return r.payload
|
|
|
|
}
|
2020-10-10 00:38:35 +03:00
|
|
|
|
|
|
|
func (r *httpMessage) ContentType() string {
|
|
|
|
return r.contentType
|
|
|
|
}
|
|
|
|
|
2020-11-18 13:08:50 +03:00
|
|
|
func (r *httpMessage) Header() metadata.Metadata {
|
2020-10-10 00:38:35 +03:00
|
|
|
return r.header
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *httpMessage) Body() []byte {
|
|
|
|
return r.body
|
|
|
|
}
|
|
|
|
|
2020-11-25 23:44:32 +03:00
|
|
|
func (r *httpMessage) Codec() codec.Codec {
|
2020-10-10 00:38:35 +03:00
|
|
|
return r.codec
|
|
|
|
}
|