micro/client/rpc_request.go

34 lines
603 B
Go
Raw Normal View History

2015-01-13 23:31:27 +00:00
package client
2015-05-23 17:40:53 +01:00
type rpcRequest struct {
2015-05-23 11:53:40 +01:00
service string
method string
contentType string
request interface{}
2015-01-13 23:31:27 +00:00
}
2015-05-23 17:40:53 +01:00
func newRpcRequest(service, method string, request interface{}, contentType string) Request {
return &rpcRequest{
2015-01-13 23:31:27 +00:00
service: service,
method: method,
request: request,
contentType: contentType,
}
}
2015-05-23 17:40:53 +01:00
func (r *rpcRequest) ContentType() string {
2015-01-13 23:31:27 +00:00
return r.contentType
}
2015-05-23 17:40:53 +01:00
func (r *rpcRequest) Service() string {
2015-01-13 23:31:27 +00:00
return r.service
}
2015-05-23 17:40:53 +01:00
func (r *rpcRequest) Method() string {
2015-01-13 23:31:27 +00:00
return r.method
}
2015-05-23 17:40:53 +01:00
func (r *rpcRequest) Request() interface{} {
2015-01-13 23:31:27 +00:00
return r.request
}