mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
24 lines
462 B
Go
24 lines
462 B
Go
|
// +build go1.7
|
||
|
|
||
|
package apns2
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
// A Context carries a deadline, a cancellation signal, and other values across
|
||
|
// API boundaries.
|
||
|
//
|
||
|
// Context's methods may be called by multiple goroutines simultaneously.
|
||
|
type Context interface {
|
||
|
context.Context
|
||
|
}
|
||
|
|
||
|
func (c *Client) requestWithContext(ctx Context, req *http.Request) (*http.Response, error) {
|
||
|
if ctx != nil {
|
||
|
req = req.WithContext(ctx)
|
||
|
}
|
||
|
return c.HTTPClient.Do(req)
|
||
|
}
|