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

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package apache
     4  
     5  import (
     6  	"errors"
     7  	"net/http"
     8  	"strings"
     9  
    10  	"github.com/netdata/go.d.plugin/pkg/web"
    11  )
    12  
    13  func (a Apache) verifyConfig() error {
    14  	if a.URL == "" {
    15  		return errors.New("url not set")
    16  	}
    17  	if !strings.HasSuffix(a.URL, "?auto") {
    18  		return errors.New("invalid URL, should ends in '?auto'")
    19  	}
    20  	return nil
    21  }
    22  
    23  func (a Apache) initHTTPClient() (*http.Client, error) {
    24  	return web.NewHTTPClient(a.Client)
    25  }