From 8117b95faa7816cbc5879524889542c71c7331d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Sun, 11 Dec 2022 18:12:30 -0300 Subject: [PATCH] Updated Modifiers (markdown) --- Modifiers.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Modifiers.md b/Modifiers.md index 3d6fddf..4f7ffff 100644 --- a/Modifiers.md +++ b/Modifiers.md @@ -60,16 +60,22 @@ Registering a new Modifier is simple: Describe it using an instance of `ksqlmodi ```golang func init() { ksqlmodifiers.RegisterAttrModifier("my_modifier_name", ksqlmodifiers.AttrModifier{ - SkipInserts: false, // set it to true if you want this modifier to cause the field to be ignored on inserts. + // Set SkipInserts to true if you want this modifier to + // cause the field to be ignored on inserts. + SkipInserts: false, - SkipUpdates: false, // set it to true if you want this modifier to cause the field to be ignored on updates. + // Set SkipUpdates to true if you want this modifier to + // cause the field to be ignored on updates. + SkipUpdates: false, Scan: func(ctx context.Context, opInfo ksqlmodifiers.OpInfo, attrPtr interface{}, dbValue interface{}) error { - // Read the dbValue, modify it and then save it into the attrPtr argument using reflection. + // Read the dbValue, modify it and then save it + // into the attrPtr argument using reflection if necessary. }, Value: func(ctx context.Context, opInfo ksqlmodifiers.OpInfo, inputValue interface{}) (outputValue interface{}, _ error) { - // Read the inputValue, modify it and then return it so the database can save it. + // Read the inputValue, modify it and then + // return it so the database can save it. }, }) }