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

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package dnsdist
     4  
     5  import (
     6  	"errors"
     7  	"net/http"
     8  
     9  	"github.com/netdata/go.d.plugin/agent/module"
    10  	"github.com/netdata/go.d.plugin/pkg/web"
    11  )
    12  
    13  func (d DNSdist) validateConfig() error {
    14  	if d.URL == "" {
    15  		return errors.New("URL not set")
    16  	}
    17  
    18  	if _, err := web.NewHTTPRequest(d.Request); err != nil {
    19  		return err
    20  	}
    21  
    22  	return nil
    23  }
    24  
    25  func (d DNSdist) initHTTPClient() (*http.Client, error) {
    26  	return web.NewHTTPClient(d.Client)
    27  }
    28  
    29  func (d DNSdist) initCharts() (*module.Charts, error) {
    30  	return charts.Copy(), nil
    31  }