| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package openvpn |
| 4 | |
| 5 | import ( |
| 6 | "github.com/netdata/netdata/go/plugins/pkg/matcher" |
| 7 | "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/openvpn/client" |
| 8 | "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" |
| 9 | ) |
| 10 | |
| 11 | func (c *Collector) validateConfig() error { |
| 12 | return nil |
| 13 | } |
| 14 | |
| 15 | func (c *Collector) initPerUserMatcher() (matcher.Matcher, error) { |
| 16 | if c.PerUserStats.Empty() { |
| 17 | return nil, nil |
| 18 | } |
| 19 | return c.PerUserStats.Parse() |
| 20 | } |
| 21 | |
| 22 | func (c *Collector) initClient() *client.Client { |
| 23 | config := socket.Config{ |
| 24 | Address: c.Address, |
| 25 | Timeout: c.Timeout.Duration(), |
| 26 | } |
| 27 | return &client.Client{Client: socket.New(config)} |
| 28 | } |