Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
metadata-collect-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
metadata-collect-agent
Commits
425148f8
Commit
425148f8
authored
May 26, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go plugin example
parent
0a01fabf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
src/go_plugin.go
src/go_plugin.go
+29
-0
No files found.
src/go_plugin.go
0 → 100644
View file @
425148f8
package
main
import
"github.com/fluent/fluent-bit-go/output"
//export FLBPluginRegister
func
FLBPluginRegister
(
def
unsafe
.
Pointer
)
int
{
// Gets called only once when the plugin.so is loaded
return
output
.
FLBPluginRegister
(
ctx
,
"gstdout"
,
"Stdout GO!"
)
}
//export FLBPluginInit
func
FLBPluginInit
(
plugin
unsafe
.
Pointer
)
int
{
// Gets called only once for each instance you have configured.
return
output
.
FLB_OK
}
//export FLBPluginFlushCtx
func
FLBPluginFlushCtx
(
ctx
,
data
unsafe
.
Pointer
,
length
C
.
int
,
tag
*
C
.
char
)
int
{
// Gets called with a batch of records to be written to an instance.
return
output
.
FLB_OK
}
//export FLBPluginExit
func
FLBPluginExit
()
int
{
return
output
.
FLB_OK
}
func
main
()
{
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment