diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/fluentd/init.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/init.go b/src/go/collectors/go.d.plugin/modules/fluentd/init.go new file mode 100644 index 000000000..d8df8b3ab --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/fluentd/init.go @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package fluentd + +import ( + "errors" + + "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/go.d.plugin/pkg/web" +) + +func (f *Fluentd) validateConfig() error { + if f.URL == "" { + return errors.New("url not set") + } + + return nil +} + +func (f *Fluentd) initPermitPluginMatcher() (matcher.Matcher, error) { + if f.PermitPlugin == "" { + return matcher.TRUE(), nil + } + + return matcher.NewSimplePatternsMatcher(f.PermitPlugin) +} + +func (f *Fluentd) initApiClient() (*apiClient, error) { + client, err := web.NewHTTPClient(f.Client) + if err != nil { + return nil, err + } + + return newAPIClient(client, f.Request), nil +} |