2020-10-16 09:38:57 +03:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
2023-04-11 22:20:37 +03:00
|
|
|
"go.unistack.org/micro/v4/codec"
|
|
|
|
"go.unistack.org/micro/v4/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
|
|
|
|
}
|
|
|
|
|
2022-03-21 15:23:41 +03:00
|
|
|
func (r *rpcMessage) Body() interface{} {
|
2020-10-16 09:38:57 +03:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|