2020-10-16 09:38:57 +03:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/unistack-org/micro/v3/codec"
|
2020-11-18 16:50:41 +03:00
|
|
|
"github.com/unistack-org/micro/v3/metadata"
|
2020-10-16 09:38:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type rpcMessage struct {
|
|
|
|
payload interface{}
|
2021-03-06 19:45:13 +03:00
|
|
|
codec codec.Codec
|
2020-11-18 16:50:41 +03:00
|
|
|
header metadata.Metadata
|
2021-03-06 19:45:13 +03:00
|
|
|
topic string
|
|
|
|
contentType string
|
2020-10-16 09:38:57 +03:00
|
|
|
body []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rpcMessage) ContentType() string {
|
|
|
|
return r.contentType
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rpcMessage) Topic() string {
|
|
|
|
return r.topic
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rpcMessage) Payload() interface{} {
|
|
|
|
return r.payload
|
|
|
|
}
|
|
|
|
|
2020-11-18 16:50:41 +03:00
|
|
|
func (r *rpcMessage) Header() metadata.Metadata {
|
2020-10-16 09:38:57 +03:00
|
|
|
return r.header
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rpcMessage) Body() []byte {
|
|
|
|
return r.body
|
|
|
|
}
|
|
|
|
|
2020-11-23 16:18:47 +03:00
|
|
|
func (r *rpcMessage) Codec() codec.Codec {
|
2020-10-16 09:38:57 +03:00
|
|
|
return r.codec
|
|
|
|
}
|