Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
883e71d6
Commit
883e71d6
authored
Jan 25, 2018
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fluentbit-wendelin: use gowork
parent
41df0b0e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
90 deletions
+58
-90
software/fluentbit/gowork.cfg
software/fluentbit/gowork.cfg
+27
-0
software/fluentbit/instance.cfg.in
software/fluentbit/instance.cfg.in
+4
-11
software/fluentbit/software.cfg
software/fluentbit/software.cfg
+9
-71
software/fluentbit/wendelin-plugin/out_wendelin.go
software/fluentbit/wendelin-plugin/out_wendelin.go
+18
-8
No files found.
software/fluentbit/gowork.cfg
0 → 100644
View file @
883e71d6
# Code generated by gowork-snapshot; DO NOT EDIT.
# list of go git repositories to fetch
[gowork.goinstall]
depends_gitfetch =
${go_github.com_fluent_fluent-bit-go:recipe}
${go_github.com_ugorji_go:recipe}
${go_lab.nexedi.com_nexedi_fluentbit-plugin-wendelin:recipe}
[go_github.com_fluent_fluent-bit-go]
<= go-git-package
go.importpath = github.com/fluent/fluent-bit-go
repository = https://github.com/fluent/fluent-bit-go
revision = c4a158a6e3
[go_github.com_ugorji_go]
<= go-git-package
go.importpath = github.com/ugorji/go
repository = https://github.com/ugorji/go
revision = 9831f2c3ac
[go_lab.nexedi.com_nexedi_fluentbit-plugin-wendelin]
<= go-git-package
go.importpath = lab.nexedi.com/nexedi/fluentbit-plugin-wendelin
repository = https://lab.nexedi.com/nexedi/fluentbit-plugin-wendelin.git
revision = cee747bffd
software/fluentbit/instance.cfg.in
View file @
883e71d6
[buildout]
parts =
fluentbit-service
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
...
...
@@ -15,13 +16,5 @@ script = ${:etc}/run/
service = ${:etc}/service
promise = ${:etc}/promise/
log = ${:var}/log
bin = ${:home}/bi
n
bin = ${:home}/bi
[fluentbit-service]
recipe = slapos.cookbook:wrapper
command-line =
{{ fluentbit_source_location }}/build/bin/fluent-bit -e
{{ wendelin_test_path}}/{{ wendelin_plugin_filename }}.so
-c {{ wendelin_conf_file }}//conf.cnf
wrapper-path = ${directory:service}/fluentbit-service
output = $${:wrapper-path}
\ No newline at end of file
software/fluentbit/software.cfg
View file @
883e71d6
...
...
@@ -5,17 +5,17 @@ extends =
../../component/golang/buildout.cfg
parts =
golang19
slapos-cookbook
gowork
fluentbit-source
fluentbit
instance-profile
fluentbit-go-repository
fluentbit-build-go
# wendelin-profile
wendelin-plugin-file
wendelin-test
wendelin-conf-file
[gowork]
buildflags = -buildmode=c-shared
install =
github.com/fluent/fluent-bit-go/output \
lab.nexedi.com/nexedi/fluentbit-plugin-wendelin
[instance-profile]
recipe = slapos.recipe.template:jinja2
...
...
@@ -25,11 +25,7 @@ rendered = ${buildout:directory}/instance.cfg
mode = 0644
context =
section buildout buildout
key fluentbit_source_location fluentbit-source:location
key fluentbit_go_repository_location fluentbit-go-repository:location
key wendelin_test_path wendelin-test:path
key wendelin_plugin_filename wendelin-plugin-file:filename
key wendelin_conf_file wendelin-conf-file:location
# key fluentbit_source_location fluentbit-source:location
[fluentbit-source]
recipe = slapos.recipe.build:gitclone
...
...
@@ -44,61 +40,3 @@ configure-command =
make-targets =
make-binary =
cd build && make
[fluentbit-go-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/fluent/fluent-bit-go
[fluentbit-build-go]
recipe = slapos.recipe.cmmi
go = ${golang19:location}/bin/go
path = ${fluentbit-go-repository:location}
configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
make-binary =
make-targets = cd ${:path}/examples/out_gstdout &&
${:go} build -buildmode=c-shared -o out_gstdout.so out_gstdout.go
[wendelin-plugin-file]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/wendelin-plugin/out_wendelin.go
#md5sum = 88c4c33e374ea3f61cdd36b2816d24ba
filename = out_wendelin.go
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[wendelin-conf-file]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/wendelin-plugin/conf.cnf
#md5sum = 88c4c33e374ea3f61cdd36b2816d24ba
filename = conf.cnf
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[wendelin-test]
recipe = slapos.recipe.cmmi
go = ${golang19:location}/bin/go
path = ${wendelin-plugin-file:location}
configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
make-binary =
make-targets = cd ${:path} &&
${:go} build -buildmode=c-shared -o ${wendelin-plugin-file:filename}.so ${wendelin-plugin-file:filename}
#[wendelin-profile]
#recipe = slapos.recipe.template:jinja2
#template = ${:_profile_base_location_}/wendelin-plugin/out_wendelin.go
#rendered = ${fluentbit-go-repository:location}/examples/out_gstdout/out_wendelin.go
#md5sum = a4cc579e1a4dd0eb58792a8dc6d47bc9
#mode = 0644
#[wendelin-test]
#recipe = slapos.recipe.cmmi
#go = ${golang19:location}/bin/go
#path = ${fluentbit-go-repository:location}
#configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
#make-binary =
#make-targets = cd ${:path}/examples/out_gstdout &&
# ${:go} build -buildmode=c-shared -o out_wendelin.so out_wendelin.go
software/fluentbit/wendelin-plugin/out_wendelin.go
View file @
883e71d6
package
main
import
"github.com/fluent/fluent-bit-go/output"
import
"github.com/lucas-clemente/quic-go"
/*import "github.com/lucas-clemente/quic-go/h2quic"
import "github.com/lucas-clemente/quic-go/internal/protocol"
*/
import
(
"fmt"
"unsafe"
"C"
"net/http"
"strconv"
"bytes"
"regexp"
// "net/http"
// "strconv"
// "bytes"
// "regexp"
)
// configuration parameters
...
...
@@ -46,7 +49,14 @@ func FLBPluginInit(ctx unsafe.Pointer) int {
//export FLBPluginFlush
func
FLBPluginFlush
(
data
unsafe
.
Pointer
,
length
C
.
int
,
tag
*
C
.
char
)
int
{
request_string
:=
uri
+
"/ingest?reference="
+
reference
fmt
.
Printf
(
"
\n
just printing
\n
"
)
/* versions := protocol.SupportedVersions
roundTripper := &h2quic.RoundTripper{
QuicConfig: &quic.Config{Versions: versions},
}*/
/* request_string := uri + "/ingest?reference=" + reference
var b []byte
b = C.GoBytes(data, C.int(length))
...
...
@@ -77,7 +87,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int {
* - 204: No Content
* - 205: Reset content
*/
re
:=
regexp
.
MustCompile
(
"[0-9]+"
)
// get only the status code
/*
re := regexp.MustCompile("[0-9]+") // get only the status code
status_code := re.FindAllString(resp.Status, -1)
resp_status, err := strconv.Atoi(status_code[0])
if err != nil {
...
...
@@ -93,7 +103,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int {
}
defer resp.Body.Close()
*/
/*
* Return options:
*
...
...
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