Support headers

Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
This commit is contained in:
Maksym Pavlenko
2019-05-23 13:34:04 -07:00
parent f82148331a
commit 5926a92b70
6 changed files with 226 additions and 5 deletions

View File

@@ -99,6 +99,10 @@ func (c *Client) Call(ctx context.Context, service, method string, req, resp int
cresp = &Response{}
)
if headers, ok := GetHeaders(ctx); ok {
creq.Headers = headers
}
if dl, ok := ctx.Deadline(); ok {
creq.TimeoutNano = dl.Sub(time.Now()).Nanoseconds()
}