File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1- module github.com/fluent/fluent-bit-go/examples/gstdout
1+ module github.com/fluent/fluent-bit-go/examples/out_gstdout
22
33go 1.14
44
Original file line number Diff line number Diff line change 1- module github.com/fluent/fluent-bit-go/examples/multiinstance
1+ module github.com/fluent/fluent-bit-go/examples/out_multiinstance
22
33go 1.14
44
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
1212
1313//export FLBPluginRegister
1414func FLBPluginRegister (def unsafe.Pointer ) int {
15+ log .Printf ("[multiinstance] Register called" )
1516 return output .FLBPluginRegister (def , "multiinstance" , "Testing multiple instances." )
1617}
1718
@@ -78,8 +79,17 @@ func FLBPluginExit() int {
7879
7980//export FLBPluginExitCtx
8081func FLBPluginExitCtx (ctx unsafe.Pointer ) int {
82+ // Type assert context back into the original type for the Go variable
83+ id := output .FLBPluginGetContext (ctx ).(string )
84+ log .Printf ("[multiinstance] Exit called for id: %s" , id )
8185 return output .FLB_OK
8286}
8387
88+ //export FLBPluginUnregister
89+ func FLBPluginUnregister (def unsafe.Pointer ) {
90+ log .Print ("[multiinstance] Unregister called" )
91+ output .FLBPluginUnregister (def )
92+ }
93+
8494func main () {
8595}
You can’t perform that action at this time.
0 commit comments