aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugin/metadata/provider.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugin/metadata/provider.go b/plugin/metadata/provider.go
index 9f6978dd2..b22064200 100644
--- a/plugin/metadata/provider.go
+++ b/plugin/metadata/provider.go
@@ -6,7 +6,14 @@
//
// Basic example:
//
-// Implement the Provider interface for a plugin:
+// Implement the Provider interface for a plugin p:
+//
+// func (p P) Metadata(ctx context.Context, state request.Request) context.Context {
+// metadata.SetValueFunc(ctx, "test/something", func() string { return "myvalue" })
+// return ctx
+// }
+//
+// Basic example with caching:
//
// func (p P) Metadata(ctx context.Context, state request.Request) context.Context {
// cached := ""
@@ -21,7 +28,7 @@
// return ctx
// }
//
-// Check the metadata from another plugin:
+// If you need access to this metadata from another plugin:
//
// // ...
// valueFunc := metadata.ValueFunc(ctx, "test/something")