2018-12-19 15:33:23 +08:00
|
|
|
package http
|
|
|
|
|
2020-11-18 13:08:50 +03:00
|
|
|
import (
|
2023-04-28 21:59:31 +03:00
|
|
|
"go.unistack.org/micro/v4/codec"
|
|
|
|
"go.unistack.org/micro/v4/metadata"
|
2020-11-18 13:08:50 +03:00
|
|
|
)
|
2020-10-10 00:38:35 +03:00
|
|
|
|
2018-12-19 17:47:03 +08:00
|
|
|
type httpMessage struct {
|
2018-12-19 15:33:23 +08: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 15:33:23 +08:00
|
|
|
}
|
|
|
|
|
2018-12-19 17:47:03 +08:00
|
|
|
func (r *httpMessage) Topic() string {
|
2018-12-19 15:33:23 +08:00
|
|
|
return r.topic
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2022-03-21 15:29:40 +03:00
|
|
|
func (r *httpMessage) Body() interface{} {
|
|
|
|
return r.payload
|
2020-10-10 00:38:35 +03:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|