func New()

in internal/output/webhook/webhook.go [29:47]


func New(opts *output.Options) (output.Output, error) {
	if _, err := url.Parse(opts.Addr); err != nil {
		return nil, fmt.Errorf("address must be a valid URL for webhook output: %w", err)
	}

	if opts.Timeout < 0 {
		return nil, fmt.Errorf("timeout must not be negative: %v", opts.Timeout)
	}
	client := &http.Client{
		Timeout: opts.Timeout,
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: opts.InsecureTLS,
			},
		},
	}

	return &Output{opts: opts, client: client}, nil
}