micro-server-http/message.go

36 lines
592 B
Go
Raw Normal View History

2018-12-19 15:33:23 +08:00
package http
import (
"go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v4/metadata"
)
2018-12-19 17:47:03 +08:00
type httpMessage struct {
2018-12-19 15:33:23 +08:00
payload interface{}
codec codec.Codec
header metadata.Metadata
topic string
contentType string
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
}
func (r *httpMessage) ContentType() string {
return r.contentType
}
func (r *httpMessage) Header() metadata.Metadata {
return r.header
}
func (r *httpMessage) Body() interface{} {
return r.payload
}
func (r *httpMessage) Codec() codec.Codec {
return r.codec
}