summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/pkg/web/doc_test.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/go/collectors/go.d.plugin/pkg/web/doc_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/pkg/web/doc_test.go b/src/go/collectors/go.d.plugin/pkg/web/doc_test.go
new file mode 100644
index 000000000..137eed207
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/pkg/web/doc_test.go
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package web
+
+func ExampleHTTP_usage() {
+ // Just embed HTTP into your module structure.
+ // It allows you to have both Request and Client fields in the module configuration file.
+ type myModule struct {
+ HTTP `yaml:",inline"`
+ }
+
+ var m myModule
+ _, _ = NewHTTPRequest(m.Request)
+ _, _ = NewHTTPClient(m.Client)
+}