diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/phpdaemon/init.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/init.go b/src/go/collectors/go.d.plugin/modules/phpdaemon/init.go new file mode 100644 index 000000000..0f05d01ee --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/phpdaemon/init.go @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package phpdaemon + +import ( + "errors" + + "github.com/netdata/netdata/go/go.d.plugin/pkg/web" +) + +func (p *PHPDaemon) validateConfig() error { + if p.URL == "" { + return errors.New("url not set") + } + if _, err := web.NewHTTPRequest(p.Request); err != nil { + return err + } + return nil +} + +func (p *PHPDaemon) initClient() (*client, error) { + httpClient, err := web.NewHTTPClient(p.Client) + if err != nil { + return nil, err + } + return newAPIClient(httpClient, p.Request), nil +} |