diff --git a/server/request.go b/server/request.go index 2e0472ba..1cde9feb 100644 --- a/server/request.go +++ b/server/request.go @@ -1,21 +1,9 @@ package server import ( - raw "github.com/unistack-org/micro-codec-bytes" "github.com/unistack-org/micro/v3/codec" ) -type rpcRequest struct { - service string - method string - contentType string - codec codec.Codec - header map[string]string - body []byte - stream bool - payload interface{} -} - type rpcMessage struct { topic string contentType string @@ -25,46 +13,6 @@ type rpcMessage struct { codec codec.Codec } -func (r *rpcRequest) ContentType() string { - return r.contentType -} - -func (r *rpcRequest) Service() string { - return r.service -} - -func (r *rpcRequest) Method() string { - return r.method -} - -func (r *rpcRequest) Endpoint() string { - return r.method -} - -func (r *rpcRequest) Codec() codec.Reader { - return r.codec -} - -func (r *rpcRequest) Header() map[string]string { - return r.header -} - -func (r *rpcRequest) Read() ([]byte, error) { - f := &raw.Frame{} - if err := r.codec.ReadBody(f); err != nil { - return nil, err - } - return f.Data, nil -} - -func (r *rpcRequest) Stream() bool { - return r.stream -} - -func (r *rpcRequest) Body() interface{} { - return r.payload -} - func (r *rpcMessage) ContentType() string { return r.contentType }