summaryrefslogtreecommitdiffstats
path: root/src/go/plugin/go.d/pkg
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:26:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:26:49 +0000
commit557d39be2a575c8a340ead48af2fc6e709d52a00 (patch)
tree5f0b3a62a1a0ff8eedf21d5f06ffab03dfac2785 /src/go/plugin/go.d/pkg
parentReleasing debian version 1.47.2-1. (diff)
downloadnetdata-557d39be2a575c8a340ead48af2fc6e709d52a00.tar.xz
netdata-557d39be2a575c8a340ead48af2fc6e709d52a00.zip
Merging upstream version 1.47.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/go/plugin/go.d/pkg')
-rw-r--r--src/go/plugin/go.d/pkg/socket/client.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/go/plugin/go.d/pkg/socket/client.go b/src/go/plugin/go.d/pkg/socket/client.go
index 26ae1dfa..c2bcbd9e 100644
--- a/src/go/plugin/go.d/pkg/socket/client.go
+++ b/src/go/plugin/go.d/pkg/socket/client.go
@@ -21,6 +21,15 @@ func New(config Config) *Socket {
}
}
+func ConnectAndRead(config Config, process Processor) error {
+ s := New(config)
+ if err := s.Connect(); err != nil {
+ return err
+ }
+ defer func() { _ = s.Disconnect() }()
+ return read(s.conn, process, s.ReadTimeout)
+}
+
// Socket is the implementation of a socket client.
type Socket struct {
Config