File tree 1 file changed +7
-4
lines changed
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).
44
44
45
45
## Add A New ` custom_func `
46
46
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
48
48
[ doing this] ( ../extensions/omniv21/samples/customfileformats/jsonlog/sample_test.go ) (note the linked
49
49
sample does more than just adding a new ` custom_func ` ):
50
50
```
72
72
}
73
73
```
74
74
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 ` .
78
81
79
82
## Add A New File Format
80
83
You can’t perform that action at this time.
0 commit comments