2015-01-14 02:31:27 +03:00
|
|
|
package client
|
|
|
|
|
|
|
|
type RpcRequest struct {
|
2015-05-23 13:53:40 +03:00
|
|
|
service string
|
|
|
|
method string
|
|
|
|
contentType string
|
|
|
|
request interface{}
|
2015-01-14 02:31:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func newRpcRequest(service, method string, request interface{}, contentType string) *RpcRequest {
|
|
|
|
return &RpcRequest{
|
|
|
|
service: service,
|
|
|
|
method: method,
|
|
|
|
request: request,
|
|
|
|
contentType: contentType,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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) Request() interface{} {
|
|
|
|
return r.request
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewRpcRequest(service, method string, request interface{}, contentType string) *RpcRequest {
|
|
|
|
return newRpcRequest(service, method, request, contentType)
|
|
|
|
}
|