File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ supported built-in `custom_func`s are listed [here](./customfuncs.md).
4444
4545## Add A New `custom_func`
4646
47- If the built-in `custom_func`s are enough, you can add your own custom functions by
47+ If the built-in `custom_func`s aren't enough, you can add your own custom functions by
4848[doing this](../extensions/omniv21/samples/customfileformats/jsonlog/sample_test.go) (note the linked
4949sample does more than just adding a new `custom_func`):
5050```
7272}
7373```
7474
75- Each `custom_func` must be a Golang function with the first param being `*transformctx.Ctx`. The rest
76- params can be of any type, as long as they will match the types of data that are fed into the function
77- in `transform_declarations`.
75+ Each `custom_func` must be a Golang function with the first param being `*transformctx.Ctx`. There can be
76+ an optional second param of `*idr.Node` type (like in this
77+ [sample](../extensions/omniv21/samples/customfuncs/sample_test.go)). If omniparser detects a `custom_func`
78+ second param is of `*idr.Node` type, then the current contextual IDR node will be passed into the function
79+ automatically. The rest params can be of any type, as long as they will match the types of data that are
80+ fed into the function in `transform_declarations`.
7881
7982## Add A New File Format
8083
You can’t perform that action at this time.
0 commit comments