github.com/netdata/go.d.plugin@v0.58.1/modules/windows/init.go (about)

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package windows
     4  
     5  import (
     6  	"errors"
     7  	"net/http"
     8  
     9  	"github.com/netdata/go.d.plugin/pkg/prometheus"
    10  	"github.com/netdata/go.d.plugin/pkg/web"
    11  )
    12  
    13  func (w *Windows) validateConfig() error {
    14  	if w.URL == "" {
    15  		return errors.New("'url' is not set")
    16  	}
    17  	return nil
    18  }
    19  
    20  func (w *Windows) initHTTPClient() (*http.Client, error) {
    21  	return web.NewHTTPClient(w.Client)
    22  }
    23  
    24  func (w *Windows) initPrometheusClient(client *http.Client) (prometheus.Prometheus, error) {
    25  	return prometheus.New(client, w.Request), nil
    26  }