github.com/netdata/go.d.plugin@v0.58.1/modules/powerdns_recursor/init.go (about) 1 // SPDX-License-Identifier: GPL-3.0-or-later 2 3 package powerdns_recursor 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 (r Recursor) validateConfig() error { 14 if r.URL == "" { 15 return errors.New("URL not set") 16 } 17 if _, err := web.NewHTTPRequest(r.Request); err != nil { 18 return err 19 } 20 return nil 21 } 22 23 func (r Recursor) initHTTPClient() (*http.Client, error) { 24 return web.NewHTTPClient(r.Client) 25 } 26 27 func (r Recursor) initCharts() (*module.Charts, error) { 28 return charts.Copy(), nil 29 }