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
2
2
3
3
go 1.14
4
4
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
2
2
3
3
go 1.14
4
4
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
13
13
//export FLBPluginRegister
14
14
func FLBPluginRegister (def unsafe.Pointer ) int {
15
+ log .Printf ("[multiinstance] Register called" )
15
16
return output .FLBPluginRegister (def , "multiinstance" , "Testing multiple instances." )
16
17
}
17
18
@@ -78,8 +79,17 @@ func FLBPluginExit() int {
78
79
79
80
//export FLBPluginExitCtx
80
81
func 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 )
81
85
return output .FLB_OK
82
86
}
83
87
88
+ //export FLBPluginUnregister
89
+ func FLBPluginUnregister (def unsafe.Pointer ) {
90
+ log .Print ("[multiinstance] Unregister called" )
91
+ output .FLBPluginUnregister (def )
92
+ }
93
+
84
94
func main () {
85
95
}
You can’t perform that action at this time.
0 commit comments