Commit 883e71d6 authored by Eteri's avatar Eteri

fluentbit-wendelin: use gowork

parent 41df0b0e
# 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
[buildout] [buildout]
parts = parts =
fluentbit-service
eggs-directory = {{ buildout['eggs-directory'] }} eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }} develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
...@@ -15,13 +16,5 @@ script = ${:etc}/run/ ...@@ -15,13 +16,5 @@ script = ${:etc}/run/
service = ${:etc}/service service = ${:etc}/service
promise = ${:etc}/promise/ promise = ${:etc}/promise/
log = ${:var}/log log = ${:var}/log
bin = ${:home}/bin 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
...@@ -5,17 +5,17 @@ extends = ...@@ -5,17 +5,17 @@ extends =
../../component/golang/buildout.cfg ../../component/golang/buildout.cfg
parts = parts =
golang19 gowork
slapos-cookbook
fluentbit-source fluentbit-source
fluentbit fluentbit
instance-profile instance-profile
fluentbit-go-repository
fluentbit-build-go [gowork]
# wendelin-profile buildflags = -buildmode=c-shared
wendelin-plugin-file install =
wendelin-test github.com/fluent/fluent-bit-go/output \
wendelin-conf-file lab.nexedi.com/nexedi/fluentbit-plugin-wendelin
[instance-profile] [instance-profile]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -25,11 +25,7 @@ rendered = ${buildout:directory}/instance.cfg ...@@ -25,11 +25,7 @@ rendered = ${buildout:directory}/instance.cfg
mode = 0644 mode = 0644
context = context =
section buildout buildout section buildout buildout
key fluentbit_source_location fluentbit-source:location # 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
[fluentbit-source] [fluentbit-source]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
...@@ -44,61 +40,3 @@ configure-command = ...@@ -44,61 +40,3 @@ configure-command =
make-targets = make-targets =
make-binary = make-binary =
cd build && make 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
package main package main
import "github.com/fluent/fluent-bit-go/output" 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 ( import (
"fmt" "fmt"
"unsafe" "unsafe"
"C" "C"
"net/http" // "net/http"
"strconv" // "strconv"
"bytes" // "bytes"
"regexp" // "regexp"
) )
// configuration parameters // configuration parameters
...@@ -46,7 +49,14 @@ func FLBPluginInit(ctx unsafe.Pointer) int { ...@@ -46,7 +49,14 @@ func FLBPluginInit(ctx unsafe.Pointer) int {
//export FLBPluginFlush //export FLBPluginFlush
func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int { 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 var b []byte
b = C.GoBytes(data, C.int(length)) b = C.GoBytes(data, C.int(length))
...@@ -77,7 +87,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int { ...@@ -77,7 +87,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int {
* - 204: No Content * - 204: No Content
* - 205: Reset 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) status_code := re.FindAllString(resp.Status, -1)
resp_status, err := strconv.Atoi(status_code[0]) resp_status, err := strconv.Atoi(status_code[0])
if err != nil { if err != nil {
...@@ -93,7 +103,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int { ...@@ -93,7 +103,7 @@ func FLBPluginFlush(data unsafe.Pointer, length C.int, tag *C.char) int {
} }
defer resp.Body.Close() defer resp.Body.Close()
*/
/* /*
* Return options: * Return options:
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment