@@ -97,18 +97,18 @@ func (n *SlackNotification) GetTemplater(name string, f texttemplate.FuncMap) (T
9797}
9898
9999type SlackOptions struct {
100- Username string `json:"username"`
101- Icon string `json:"icon"`
102- Token string `json:"token"`
103- SigningSecret string `json:"signingSecret"`
104- Channels []string `json:"channels"`
105- ApiURL string `json:"apiURL"`
106- DisableUnfurl bool `json:"disableUnfurl"`
107- InsecureSkipVerify bool `json:"insecureSkipVerify"`
108- MaxIdleConns int `json:"maxIdleConns"`
109- MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost"`
110- MaxConnsPerHost int `json:"maxConnsPerHost"`
111- IdleConnTimeout time. Duration `json:"idleConnTimeout"`
100+ Username string `json:"username"`
101+ Icon string `json:"icon"`
102+ Token string `json:"token"`
103+ SigningSecret string `json:"signingSecret"`
104+ Channels []string `json:"channels"`
105+ ApiURL string `json:"apiURL"`
106+ DisableUnfurl bool `json:"disableUnfurl"`
107+ InsecureSkipVerify bool `json:"insecureSkipVerify"`
108+ MaxIdleConns int `json:"maxIdleConns"`
109+ MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost"`
110+ MaxConnsPerHost int `json:"maxConnsPerHost"`
111+ IdleConnTimeout string `json:"idleConnTimeout"`
112112}
113113
114114type slackService struct {
@@ -201,7 +201,8 @@ func newSlackClient(opts SlackOptions) *slack.Client {
201201 if opts .ApiURL != "" {
202202 apiURL = opts .ApiURL
203203 }
204- transport := httputil .NewTransport (apiURL , opts .MaxIdleConns , opts .MaxIdleConnsPerHost , opts .MaxIdleConns , opts .IdleConnTimeout , opts .InsecureSkipVerify )
204+ idleConnTimeout , _ := time .ParseDuration (opts .IdleConnTimeout )
205+ transport := httputil .NewTransport (apiURL , opts .MaxIdleConns , opts .MaxIdleConnsPerHost , opts .MaxIdleConns , idleConnTimeout , opts .InsecureSkipVerify )
205206 client := & http.Client {
206207 Transport : httputil .NewLoggingRoundTripper (transport , log .WithField ("service" , "slack" )),
207208 }
0 commit comments