-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
34 lines (28 loc) · 798 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package five9
import (
"net/http"
)
type ConfigFunc func(*Service)
func AddRequestPreprocessor(things ...func(*http.Request) error) ConfigFunc {
return func(s *Service) {
s.agentService.authState.client.requestPreProcessors = append(
s.agentService.authState.client.requestPreProcessors,
things...,
)
}
}
func SetWebsocketHandler(w webSocketHandler) ConfigFunc {
return func(s *Service) {
s.supervisorService.webSocketHandler = w
}
}
func SetRoundTripper(roundTripper http.RoundTripper) ConfigFunc {
return func(s *Service) {
s.agentService.authState.client.httpClient.Transport = roundTripper
}
}
// func SetMaxCacheAge(maxAge *time.Duration) ConfigFunc {
// return func(s *Service) {
// s.agentService.authState.client.httpClient.Transport = roundTripper
// }
// }