mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
checkpoint
This commit is contained in:
@ -5,14 +5,22 @@ type rpcRequest struct {
|
||||
method string
|
||||
contentType string
|
||||
request interface{}
|
||||
opts requestOptions
|
||||
}
|
||||
|
||||
func newRpcRequest(service, method string, request interface{}, contentType string) Request {
|
||||
func newRpcRequest(service, method string, request interface{}, contentType string, reqOpts ...RequestOption) Request {
|
||||
var opts requestOptions
|
||||
|
||||
for _, o := range reqOpts {
|
||||
o(&opts)
|
||||
}
|
||||
|
||||
return &rpcRequest{
|
||||
service: service,
|
||||
method: method,
|
||||
request: request,
|
||||
contentType: contentType,
|
||||
opts: opts,
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,3 +39,7 @@ func (r *rpcRequest) Method() string {
|
||||
func (r *rpcRequest) Request() interface{} {
|
||||
return r.request
|
||||
}
|
||||
|
||||
func (r *rpcRequest) Stream() bool {
|
||||
return r.opts.stream
|
||||
}
|
||||
|
Reference in New Issue
Block a user