File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
20
20
"net/url"
21
21
"runtime"
22
22
"strings"
23
+ "time"
23
24
)
24
25
25
26
const (
@@ -28,6 +29,9 @@ const (
28
29
29
30
// Endpoint points you to MessageBird REST API.
30
31
Endpoint = "https://rest.messagebird.com"
32
+
33
+ // httpClientTimeout is used to limit http.Client waiting time.
34
+ httpClientTimeout = 15 * time .Second
31
35
)
32
36
33
37
const (
@@ -63,7 +67,12 @@ type Client struct {
63
67
64
68
// New creates a new MessageBird client object.
65
69
func New (AccessKey string ) * Client {
66
- return & Client {AccessKey : AccessKey , HTTPClient : & http.Client {}}
70
+ return & Client {
71
+ AccessKey : AccessKey ,
72
+ HTTPClient : & http.Client {
73
+ Timeout : httpClientTimeout ,
74
+ },
75
+ }
67
76
}
68
77
69
78
// Request is for internal use only and unstable.
You can’t perform that action at this time.
0 commit comments