2020-10-16 09:38:57 +03:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/unistack-org/micro/v3/codec"
|
2020-11-18 00:02:02 +03:00
|
|
|
"github.com/unistack-org/micro/v3/metadata"
|
2020-10-16 09:38:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type rpcMessage struct {
|
|
|
|
topic string
|
|
|
|
contentType string
|
|
|
|
payload interface{}
|
2020-11-18 00:02:02 +03:00
|
|
|
header metadata.Metadata
|
2020-10-16 09:38:57 +03:00
|
|
|
body []byte
|
|
|
|
codec codec.Codec
|
|
|
|
}
|
|
|
|
|
|
|
|
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 00:02:02 +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
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rpcMessage) Codec() codec.Reader {
|
|
|
|
return r.codec
|
|
|
|
}
|