2020-09-03 12:21:00 +03:00
|
|
|
package tcp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/unistack-org/micro/v3/codec"
|
|
|
|
)
|
|
|
|
|
|
|
|
type tcpRequest struct {
|
|
|
|
service string
|
|
|
|
method string
|
|
|
|
endpoint string
|
|
|
|
contentType string
|
|
|
|
header map[string]string
|
|
|
|
body interface{}
|
2020-11-25 23:56:38 +03:00
|
|
|
codec codec.Codec
|
2020-09-03 12:21:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Service() string {
|
|
|
|
return r.service
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Method() string {
|
|
|
|
return r.method
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Endpoint() string {
|
|
|
|
return r.endpoint
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) ContentType() string {
|
|
|
|
return r.contentType
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Header() map[string]string {
|
|
|
|
return r.header
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Body() interface{} {
|
|
|
|
return r.body
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Read() ([]byte, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpRequest) Stream() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2020-11-25 23:56:38 +03:00
|
|
|
func (r *tcpRequest) Codec() codec.Codec {
|
2020-09-03 12:21:00 +03:00
|
|
|
return r.codec
|
|
|
|
}
|