From 18100ee6d24a5786ec17462b671719cd8a34d2ed Mon Sep 17 00:00:00 2001 From: Simon Lawrence Date: Wed, 13 Mar 2024 16:39:45 -0400 Subject: [PATCH 1/2] Fixes for simple-processor example --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8cd8bb4..efdacab 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ func main() { } ``` -If the processor is very simple and can be reduced to a single function (e.g. +If the processor is very simple and can be reduced to a single function (e.g. no configuration needed), then we can use `sdk.NewProcessorFunc()`, as below: ```go @@ -112,13 +112,13 @@ import ( ) func main() { - sdk.Run(&sdk.NewProcessorFunc( - sdk.Specification{Name: "simple-processor"}), + sdk.Run(sdk.NewProcessorFunc( + sdk.Specification{Name: "simple-processor", Version: "v1.0.0"}, func(ctx context.Context, rec opencdc.Record) (opencdc.Record, error) { // do something with the record - return rec + return rec, nil }, - ) + )) } ``` @@ -192,4 +192,4 @@ logger := sdk.Logger(ctx) logger.Trace().Msg("Processing records") // ... } -``` \ No newline at end of file +``` From 7c7ff91e678c2dc2e7f167ca2ecbe9c286e92b8d Mon Sep 17 00:00:00 2001 From: Simon Lawrence Date: Fri, 15 Mar 2024 10:33:05 -0400 Subject: [PATCH 2/2] Remove Version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efdacab..f8b37d9 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ import ( func main() { sdk.Run(sdk.NewProcessorFunc( - sdk.Specification{Name: "simple-processor", Version: "v1.0.0"}, + sdk.Specification{Name: "simple-processor"}, func(ctx context.Context, rec opencdc.Record) (opencdc.Record, error) { // do something with the record return rec, nil