diff options
Diffstat (limited to 'src/go/plugin/go.d/modules/apache/init.go')
-rw-r--r-- | src/go/plugin/go.d/modules/apache/init.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/go/plugin/go.d/modules/apache/init.go b/src/go/plugin/go.d/modules/apache/init.go new file mode 100644 index 000000000..e13186f01 --- /dev/null +++ b/src/go/plugin/go.d/modules/apache/init.go @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package apache + +import ( + "errors" + "net/http" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +func (a *Apache) validateConfig() error { + if a.URL == "" { + return errors.New("url not set") + } + if !strings.HasSuffix(a.URL, "?auto") { + return errors.New("invalid URL, should ends in '?auto'") + } + return nil +} + +func (a *Apache) initHTTPClient() (*http.Client, error) { + return web.NewHTTPClient(a.Client) +} |