func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeOutputConfig, error) {
	conf := DefaultOutputConfig()
	if err := config.ReflectConfig(raw, &conf); err != nil {
		return nil, err
	}

	if len(conf.AcceptedHttpResult) > 0 {
		conf.acceptedHttpResult = MapFromInts(conf.AcceptedHttpResult)
	}
	if len(conf.PermanentHttpErrors) > 0 {
		conf.permanentHttpErrors = MapFromInts(conf.PermanentHttpErrors)
	}

	if len(conf.URLs) <= 0 {
		return nil, ErrNoValidURLs
	}
	conf.httpClient = &http.Client{Transport: &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).DialContext,
		MaxIdleConns:          100,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
		TLSClientConfig:       &tls.Config{InsecureSkipVerify: conf.IgnoreSSL},
	}}
	// we need at least one event in the queue to allow for resume
	if conf.MaxQueueSize == 0 || conf.MaxQueueSize < -1 {
		conf.MaxQueueSize = 1
	}
	// create the queue
	conf.queue = queue.NewSimpleQueue(ctx, control, &conf, nil, conf.MaxQueueSize, conf.RetryInterval)

	return conf.queue, nil
}
// InitHandler initialize the output plugin
InitHandler initialize the output plugin
// InitHandler initialize the output plugin
func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeOutputConfig, error) {
	conf := DefaultOutputConfig()
	if err := config.ReflectConfig(raw, &conf); err != nil {
		return nil, err
	}
	if len(conf.AcceptedHttpResult) > 0 {
		conf.acceptedHttpResult = MapFromInts(conf.AcceptedHttpResult)
	}
	if len(conf.PermanentHttpErrors) > 0 {
		conf.permanentHttpErrors = MapFromInts(conf.PermanentHttpErrors)
	}
	if len(conf.URLs) <= 0 {
		return nil, ErrNoValidURLs
	}
	conf.httpClient = &http.Client{Transport: &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).DialContext,
		MaxIdleConns:          100,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
		TLSClientConfig:       &tls.Config{InsecureSkipVerify: conf.IgnoreSSL},
	}}
	if conf.MaxQueueSize == 0 || conf.MaxQueueSize < -1 {
		conf.MaxQueueSize = 1
	}
	conf.queue = queue.NewSimpleQueue(ctx, control, &conf, nil, conf.MaxQueueSize, conf.RetryInterval)
	return conf.queue, nil
}
func InitHandler ( ctx context . Context , raw config . ConfigRaw , control config . Control , ) ( config . TypeOutputConfig , error ) { conf := DefaultOutputConfig ( ) if err := config . ReflectConfig ( raw , & conf ) ; err != nil { return nil , err } if len ( conf . AcceptedHttpResult ) > 0 { conf . acceptedHttpResult = MapFromInts ( conf . AcceptedHttpResult ) } if len ( conf . PermanentHttpErrors ) > 0 { conf . permanentHttpErrors = MapFromInts ( conf . PermanentHttpErrors ) } if len ( conf . URLs ) <= 0 { return nil , ErrNoValidURLs } conf . httpClient = & http . Client { Transport : & http . Transport { Proxy : http . ProxyFromEnvironment , DialContext : ( & net . Dialer { Timeout : 30 * time . Second , KeepAlive : 30 * time . Second , } ) . DialContext , MaxIdleConns : 100 , IdleConnTimeout : 90 * time . Second , TLSHandshakeTimeout : 10 * time . Second , ExpectContinueTimeout : 1 * time . Second , TLSClientConfig : & tls . Config { InsecureSkipVerify : conf . IgnoreSSL } , } } if conf . MaxQueueSize == 0 || conf . MaxQueueSize < - 1 { conf . MaxQueueSize = 1 } conf . queue = queue . NewSimpleQueue ( ctx , control , & conf , nil , conf . MaxQueueSize , conf . RetryInterval ) return conf . queue , nil }
InitHandler initialize the output plugin
InitHandler initialize the output plugin
// we need at least one event in the queue to allow for resume // create the queue