Skip to content

Commit d6b075e

Browse files
authored
Merge pull request #4 from leahnp/example_fixes
Separated init and register functions
2 parents 7c5a0b2 + b1c70b1 commit d6b075e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/out_gstdout/out_gstdout.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ import (
99
"reflect"
1010
)
1111

12+
//export FLBPluginRegister
13+
// ctx (context) pointer to fluentbit context (state/ c code)
14+
func FLBPluginRegister(ctx unsafe.Pointer) int {
15+
// roll call for the specifics of the plugin
16+
return output.FLBPluginRegister(ctx, "gstdout", "Stdout GO!")
17+
}
18+
1219
//export FLBPluginInit
20+
// (fluentbit will call this)
21+
// ctx (context) pointer to fluentbit context (state/ c code)
1322
func FLBPluginInit(ctx unsafe.Pointer) int {
14-
return output.FLBPluginRegister(ctx, "gstdout", "Stdout GO!")
23+
return output.FLB_OK
1524
}
1625

1726
//export FLBPluginFlush

0 commit comments

Comments
 (0)