GithubHelp home page GithubHelp logo

comcast / eel Goto Github PK

View Code? Open in Web Editor NEW
105.0 18.0 19.0 1017 KB

A simple proxy service to forward JSON events and transform or filter them along the way.

License: Apache License 2.0

Makefile 0.05% Shell 0.47% Go 96.70% HTML 2.60% Dockerfile 0.18%
transformations json-parser event-transformation

eel's Introduction

EEL - A simple Proxy Service for JSON Event Transformation and Forwarding

It's simple - a single JSON event comes in and one (or maybe a few) transformed events get out. Events are arbitrary JSON encoded payloads and they are typically sent around as HTTP POSTs. EEL is stateless and therefore scales easily.

In this example we removed the unwanted "detail" field from the event and adjusted the schema slightly.

Converting JSON payload A from service S1 into JSON payload B for service S2 is a very common operation we perform all the time in service oriented architectures. Here are some good reasons for event transformation:

  1. REDUCTION: Remove everything that's not needed and only pass the data actually required by the downstream service. This can provide performance benefits for the downstream service if processing is expensive and events are bloated.
  2. CANONICALIZATION / CLEANUP: Adjust the structure of the JSON event to validate against a given schema. Typically this can be achieved by rearranging elements in the JSON event, renaming keys and possibly filtering out unwanted subsets of data.
  3. META-TAGGING: Inject additional metadata into the JSON event. Examples are injecting UUIDs or timestamps (for example for log tracing), tagging or labeling events with type fields, calling external auxiliary services and injecting their output into the downstream payload (provided it is JSON).
  4. MAPPING / SUBSTITUTION: Map one ID type to another via look up using an external lookup service.
  5. FILTERING: Filter out unwanted events to reduce load for downstream services.
  6. FANOUT: Forward a single incoming JSON event to multiple downstream services, either by applying the same transformation for all services or by performing different transformations.

You could write each of these transformations in just a few lines of go code, and we often do. The downside is that transformations become engraved in code and cannot be changed easily.

EEL is offering a simple JSON template language combined with a proxy micro service to relay and transform events between upstream and downstream services. The goals of the EEL template language are to be simple and yet powerful. EEL can be the glue in a JSON based service oriented eco-system.

The syntax of the EEL transformation language is inspired by a few of the core concepts from XPath and XSLT applied to JSON.

Installation

go get -u github.com/comcast/eel

Usage

./eel [options...]

Options:

-config  path to config.json (default is ./config-eel/config.json)
-handlers  path to handlers (default is ./config-handlers)
-loglevel  log level (default is "info")
-env  environment name such as qa, prod for logging (default is "default")

No Nonsense

go build -o bin/eel
./bin/starteel.sh

Docker Alternative

Docker 1.13+ verified.

Build a dev image

docker build -t eel:dev .

Run an instance

docker run --rm -p 8080:8080 --name eel-dev eel:dev

The command above will utilize port 8080 of your host. You can change it to any other port via -p ANYOTHERPORT:8080

To pass parameters to eel you can use EEL_PARAMS env variable, e.g.

docker run --rm -e "EEL_PARAMS=-loglevel error" -p 8080:8080 --name eel-dev eel:dev

A Simple Example

Transformation handlers are used to tell EEL if and how to process JSON events it receives and where to forward them to. Each transformation handler is stored in a single JSON file and there may be several such handler files each of them taking care of a certain class of events. See here for more details.

Edit the default transformation handler in config-handlers/tenant1/default.json so it looks like this (there's only a small change needed in the Transformation section).

{
    "Version": "1.0",
    "Name": "Default",
    "Info": "",
    "Active": true,
    "Match": null,
    "IsMatchByExample": false,
    "TerminateOnMatch": true,
    "Transformation": {
        "{{/event}}": "{{/}}"
    },
    "IsTransformationByExample": false,
    "Path": "",
    "Verb": "POST",
    "Endpoint": "http://localhost:8082",
    "HttpHeaders": {
      "X-B3-TraceId": "{{traceid()}}",
      "X-Tenant-Id": "{{tenant()}}"
    }
}

The center piece of the handler configuration is the Transformation section which uses JPath expressions to describe the structural transformations to be performed on the incoming event before forwarding it to the downstream service. In this example we are telling EEL to take the entire payload unmodified and wrap it inside a new element called event.

Compile EEL.

EEL is implemented in go and you will need a golang environment to compile the code. However, you don't need any go coding skills to understand and author EEL templates!

The make file and shell scripts have been tested on Mac and Linux environments.

make all

Launch EEL as a service and start listening to incoming events.

./bin/starteel.sh

Send a test event to EEL.

curl -X POST --data '{ "message" : "hello world!!!" }' http://localhost:8080/v1/events

Output:

{"status":"processed"}

You can check EEL's log output eel.log to see if and how the event is processed. You can also ask for a detailed debug response using the X-Debug header.

curl -X POST -H 'X-Debug: true' --data '{ "message" : "hello world!!!" }' http://localhost:8080/v1/events

Output:

[
	{
		"api": "http",
		"handler": "Default",
		"tenant.id": "tenant1",
		"trace.in.data": {
			"message": "hello world!!!"
		},
		"trace.out.data": {
			"event": {
				"message": "hello world!!!"
			}
		},
		"trace.out.endpoint": "http://localhost:8088",
		"trace.out.headers": {
			"X-B3-TraceId": "20073ee4-d681-4ab5-a973-50c978cd1111",
			"X-Tenant-Id": "tenant1"
		},
		"trace.out.path": "",
		"trace.out.protocol": "http",
		"trace.out.url": "http://localhost:8088",
		"trace.out.verb": "POST",
		"tx.id": "20073ee4-d681-4ab5-a973-50c978cd1111",
		"tx.traceId": "20073ee4-d681-4ab5-a973-50c978cd1111"
	}
]

Or, you can use the /v1/sync/events instead of the /v1/events endpoint to get an immediate response containing the transformed event as it would be forwarded to the downstream service.

curl -X POST --data '{ "message" : "hello world!!!" }' http://localhost:8080/v1/sync/events

Output:

{
	"event": {
		"message": "hello world!!!"
	}
}

To review the current set of active transformation handlers call the health check API.

curl http://localhost:8080/v1/health

Stop EEL.

./bin/stopeel.sh

EEL as Command Line Tool

You can also start experimenting with EEL by using the command line parameters. Example:

./eel -in='{"foo":"bar"}' -tf='{"Foo":"{{/foo}}"}' -istbe=true

More examples can be found here .

Exploring EEL Features

The unit tests are a good starting point to learn more about EEL features and look at some examples in detail.

Each test is contained in its own configuration folder, for example eel/test/data/test01. Each test folder contains a complete set of handler configurations for EEL in the handlers subfolder (usually just one handler), an example input event in.json and one or more expected output events out.json.

The tests can be executed using go test:

cd eel/test
go test -v

Or, you can launch EEL with the handler configurations for a specific test and send the in.json event manually.

./eel -handlers=test/data/test01/handlers > eel.log &
curl -X POST --data @test/data/test01/in.json http://localhost:8080/v1/sync/events
No Name Test Name Description
0 Identity Transformation TestDontTouchEvent Doesn't apply any transformation and forwards everything unchanged.
1 Canonicalize TestCanonicalizeEvent Simple structural changes and array path selectors.
2 External Lookup TestInjectExternalServiceResponse Get JSON data from external service and inject into payload.
3 Transformation By Example TestTransformationByExample Describe transformation using by-example syntax rather than using by-path syntax.
4 Named Transformations TestNamedTransformations Choose from several named transformations based on input data.
5 Conditional Message Generation TestMessageGeneration Assemble message string with ifte() and equals().
6 Handler Matching 1 TestTerminateOnMatchTrue Pick best matching handler and forward single event.
7 Handler Matching 2 TestTerminateOnMatchFalse Pick all matching handlers and forward multiple events.
8 Multi Tenancy TestMultiTenancy Handlers for different tenants or apps.
9 Cascade TestSequentialHandlerCascade Cascade of multiple handlers which will be executed sequentially by using EEL recursively.
10 Java Script For Everything Else TestJavaScript If you really can't avoid it, resort to Java Script.
11 Handler Matching 3 TestMatchByExample Matching handlers using by-example syntax.
12 Convert Headers To Payload TestHeaders Inject HTTP headers from upstream service into JSON event for downstream service.
13 Custom Properties TestCustomProperties Custom properties in handlers for sharing data.
14 Fan Out TestFanOut Send incoming event to several downstream services.
15 Basic String Operations TestStringOps Uppercase, lowercase, substring.
16 Named Transformations 2 TestNamedTransformations2 Perform named transformation on external document.
17 Contains TestContains Check if one JSON event is contained in another.
18 Tenant Id Header TestMultiTenency2 Pass in tenant id as HTTP header.
19 Conditional Message Generation 2 TestMessageGeneration2 Use case() function to simplify conditional string generation.
20 Regex TestRegex Use regex() to evaluate regular expressions.
22 Filter By Path TestFilterByPath Filter event after transformation using by-path syntax.
23 Filter By Example TestFilterByExample Filter event after transformation using by-example syntax.
25 Array Path Selector TestArrayPathSelector Select elements from arrays by index or by path.
27 Iterate Over Array NamedTransformationsAndArrays Iterate over array and apply named transformation.
32 Simple Types NamedTransformationsAndSimpleTypes Apply named transformation to a simple type.
34 Join Join Merge two JSON documents.
41 Partial Matching MatchPartialArrays3 Match event against partial pattern.
46 Filter Cascade FilterCascade Apply multiple filters.
47 Choose From Array ChooseFromArray Choose elements from array by pattern.
48 Named Transformation With Array And Pattern NamedTransformationWithArrayAndPattern Apply named transformation by pattern.
49 Named Transformation With Array And Join NamedTransformationWithArrayAndJoin Apply named transformation with join.
51 Complex Example ComplexExample A real world example.
53 Crush Crush Flatten a deeply nested array.

Further Reading

eel's People

Contributors

ababich avatar atkaper avatar boriwo avatar cshiong avatar gtrevg avatar holidaymike avatar iamjarvo avatar luweiy avatar one111eric avatar plaxomike avatar toyangxia avatar va-service-account avatar wingdog avatar zeushammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eel's Issues

fatal error: concurrent map iteration and map write

I have setup a high volume pipeline with eel in the middle and found that the more workers I configure, the more frequently it crashes like this [0] when it's under high load. The attached error was caused using a worker pool of 30.

[0]

fatal error: concurrent map iteration and map write

goroutine 426404 [running]:
runtime.throw({0x974589?, 0x7f012504ca68?})
	/usr/local/go/src/runtime/panic.go:992 +0x71 fp=0xc000508ea0 sp=0xc000508e70 pc=0x437531
runtime.mapiternext(0x0?)
	/usr/local/go/src/runtime/map.go:871 +0x4eb fp=0xc000508f10 sp=0xc000508ea0 pc=0x41196b
runtime.mapiterinit(0x4673ae?, 0x43a0c7?, 0xc000508f48?)
	/usr/local/go/src/runtime/map.go:861 +0x228 fp=0xc000508f30 sp=0xc000508f10 pc=0x411428
github.com/Comcast/eel/util.(*DefaultLogWriter).log(0xc0000aaf30, {0x95c6fd, 0x4}, {0xc0000ba570, 0x24}, 0x40f2c7?, {0xc00002efc0, 0x4, 0x1?})
	/go/src/github.com/Comcast/eel/util/defaultlogger.go:94 +0x12f fp=0xc000509088 sp=0xc000508f30 pc=0x73f72f
github.com/Comcast/eel/util.(*DefaultLogger).Info(0xc000509488?, {0xc00002efc0?, 0xc0005094a8?, 0x1?})
	/go/src/github.com/Comcast/eel/util/defaultlogger.go:123 +0x4e fp=0xc0005090e0 sp=0xc000509088 pc=0x73fdee
github.com/Comcast/eel/jtl.HandleEvent({0xa472e0, 0xc000132c30}, {0xa45550?, 0xc0005421c0}, 0xc00053e500)
	/go/src/github.com/Comcast/eel/jtl/inproc.go:178 +0x36a8 fp=0xc0005099e0 sp=0xc0005090e0 pc=0x84b008
github.com/Comcast/eel/jtl.EventHandler({0xa45550, 0xc0005421c0}, 0x0?)
	/go/src/github.com/Comcast/eel/jtl/inproc.go:32 +0x4e fp=0xc000509a20 sp=0xc0005099e0 pc=0x84792e
net/http.HandlerFunc.ServeHTTP(0x72?, {0xa45550?, 0xc0005421c0?}, 0xc00050fbd0?)
	/usr/local/go/src/net/http/server.go:2084 +0x2f fp=0xc000509a48 sp=0xc000509a20 pc=0x6be78f
net/http.(*ServeMux).ServeHTTP(0x0?, {0xa45550, 0xc0005421c0}, 0xc00053e500)
	/usr/local/go/src/net/http/server.go:2462 +0x149 fp=0xc000509a98 sp=0xc000509a48 pc=0x6c05e9
net/http.serverHandler.ServeHTTP({0xa43f20?}, {0xa45550, 0xc0005421c0}, 0xc00053e500)
	/usr/local/go/src/net/http/server.go:2916 +0x43b fp=0xc000509b58 sp=0xc000509a98 pc=0x6c223b
net/http.(*conn).serve(0xc00023c140, {0xa45928, 0xc00030ce10})
	/usr/local/go/src/net/http/server.go:1966 +0x5d7 fp=0xc000509fb8 sp=0xc000509b58 pc=0x6bd237
net/http.(*Server).Serve.func3()
	/usr/local/go/src/net/http/server.go:3071 +0x2e fp=0xc000509fe0 sp=0xc000509fb8 pc=0x6c2b8e
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000509fe8 sp=0xc000509fe0 pc=0x469581
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 1 [chan receive, 6 minutes]:
main.main()
	/go/src/github.com/Comcast/eel/main.go:210 +0x3e5

goroutine 21 [chan receive, 6 minutes]:
github.com/Comcast/eel/jtl.(*TraceLogger).processTraceLogLoop.func1()
	/go/src/github.com/Comcast/eel/jtl/tracelogger.go:78 +0x18f
created by github.com/Comcast/eel/jtl.(*TraceLogger).processTraceLogLoop
	/go/src/github.com/Comcast/eel/jtl/tracelogger.go:74 +0x8a

goroutine 36 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 37 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 38 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 39 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 40 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 41 [semacquire]:
sync.runtime_Semacquire(0x10?)
	/usr/local/go/src/runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0xc0004df6b0?)
	/usr/local/go/src/sync/waitgroup.go:136 +0x52
github.com/Comcast/eel/jtl.handleEvent({0xa472e0, 0xc000590460}, 0xa40530?, 0xc0003bd3e0, {0x0?, 0x1?}, 0x0?, 0x0?)
	/go/src/github.com/Comcast/eel/jtl/outproc.go:169 +0x2c5
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:86 +0x85
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 42 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 43 [runnable]:
github.com/Comcast/eel/jtl.(*JExprItem).parse(0xc000132cd0, {0xc0000c1db0?, 0x8?})
	/go/src/github.com/Comcast/eel/jtl/parser.go:110 +0x96
github.com/Comcast/eel/jtl.NewJExpr({0xc0000c1db0, 0xa})
	/go/src/github.com/Comcast/eel/jtl/parser.go:70 +0xe8
github.com/Comcast/eel/jtl.(*JDoc).ParseExpression(0xc0000c1db0?, {0xa472e0, 0xc000132c30}, {0x8cdd80?, 0xc0004fac80?})
	/go/src/github.com/Comcast/eel/jtl/jpath.go:885 +0x65
github.com/Comcast/eel/jtl.(*JDoc).GetStringValueForExpression(0xa472e0?, {0xa472e0, 0xc000132c30}, {0xc0000c1db0?, 0xc000302800?})
	/go/src/github.com/Comcast/eel/jtl/jpath.go:967 +0x55
github.com/Comcast/eel/jtl.(*HandlerFactory).GetHandlersForEvent(0xc0003022e0, {0xa472e0, 0xc000132c30}, 0x8cdd80?)
	/go/src/github.com/Comcast/eel/jtl/handlers.go:399 +0xa5
github.com/Comcast/eel/jtl.handleEvent({0xa472e0, 0xc000132c30}, 0xa40530?, 0xc00031acf0, {0x0?, 0x1?}, 0x0?, 0x0?)
	/go/src/github.com/Comcast/eel/jtl/outproc.go:31 +0xda
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:86 +0x85
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 44 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 45 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 46 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 47 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 48 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 49 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 50 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 51 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 52 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 53 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 54 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 55 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 56 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 57 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 58 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 59 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 60 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 61 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 62 [semacquire]:
sync.runtime_Semacquire(0x10?)
	/usr/local/go/src/runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0xc000500ca0?)
	/usr/local/go/src/sync/waitgroup.go:136 +0x52
github.com/Comcast/eel/jtl.handleEvent({0xa472e0, 0xc000537900}, 0xa40530?, 0xc000341020, {0x0?, 0x1?}, 0x0?, 0x0?)
	/go/src/github.com/Comcast/eel/jtl/outproc.go:169 +0x2c5
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:86 +0x85
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 63 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 64 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 65 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 66 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 67 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 68 [select]:
github.com/Comcast/eel/jtl.(*Worker).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:82 +0xfd
created by github.com/Comcast/eel/jtl.(*Worker).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:74 +0x56

goroutine 69 [select]:
github.com/Comcast/eel/jtl.(*WorkDispatcher).Start.func1()
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:125 +0x12b
created by github.com/Comcast/eel/jtl.(*WorkDispatcher).Start
	/go/src/github.com/Comcast/eel/jtl/workerpool.go:122 +0x2ae

goroutine 70 [IO wait, 1 minutes]:
internal/poll.runtime_pollWait(0x7f00fe1d8dc8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc000314a00?, 0xc00003b900?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Accept(0xc000314a00)
	/usr/local/go/src/internal/poll/fd_unix.go:614 +0x22c
net.(*netFD).accept(0xc000314a00)
	/usr/local/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0xc00031a8e8)
	/usr/local/go/src/net/tcpsock_posix.go:139 +0x28
net.(*TCPListener).Accept(0xc00031a8e8)
	/usr/local/go/src/net/tcpsock.go:288 +0x3d
net/http.(*Server).Serve(0xc0003a0000, {0xa45340, 0xc00031a8e8})
	/usr/local/go/src/net/http/server.go:3039 +0x385
net/http.(*Server).ListenAndServe(0xc0003a0000)
	/usr/local/go/src/net/http/server.go:2968 +0x7d
net/http.ListenAndServe(...)
	/usr/local/go/src/net/http/server.go:3222
github.com/Comcast/eel/jtl.(*WebhookPlugin).startWebhookServices(0xc000302fe0, {0xa472e0?, 0xc00009ebe0})
	/go/src/github.com/Comcast/eel/jtl/webhookplugin.go:75 +0x530
created by github.com/Comcast/eel/jtl.(*WebhookPlugin).StartWebhookConsumer
	/go/src/github.com/Comcast/eel/jtl/webhookplugin.go:57 +0x10e

goroutine 512878 [select]:
net/http.(*persistConn).roundTrip(0xc0003cfd40, 0xc000300e00)
	/usr/local/go/src/net/http/transport.go:2620 +0x974
net/http.(*Transport).roundTrip(0xc00035e000, 0xc0000d9000)
	/usr/local/go/src/net/http/transport.go:594 +0x7c9
net/http.(*Transport).RoundTrip(0xc0000d9000?, 0xa42220?)
	/usr/local/go/src/net/http/roundtrip.go:17 +0x19
net/http.send(0xc0000d8f00, {0xa42220, 0xc00035e000}, {0x94c840?, 0x4cad01?, 0xd07a40?})
	/usr/local/go/src/net/http/client.go:252 +0x5d8
net/http.(*Client).send(0xc00030c540, 0xc0000d8f00, {0xc000055000?, 0xc0003cfc20?, 0xd07a40?})
	/usr/local/go/src/net/http/client.go:176 +0x9b
net/http.(*Client).do(0xc00030c540, 0xc0000d8f00)
	/usr/local/go/src/net/http/client.go:725 +0x8f5
net/http.(*Client).Do(...)
	/usr/local/go/src/net/http/client.go:593
github.com/Comcast/eel/util.HitEndpoint({0xa472e0, 0xc000537db0}, {0xc00033a090, 0x2f}, {0xc0003d4000, 0x2c0}, {0xc0003247a0, 0x4}, 0xc0004fde30, 0x0)
	/go/src/github.com/Comcast/eel/util/http.go:155 +0xb45
github.com/Comcast/eel/util.(*DefaultRetrier).Retry(0x60, {0xa472e0, 0xc000537db0}, {0xc00033a090, 0x2f}, {0xc0003d4000, 0x2c0}, {0xc0003247a0, 0x4}, 0xc0004fde30, ...)
	/go/src/github.com/Comcast/eel/util/defaultretrier.go:39 +0x1a7
github.com/Comcast/eel/util.(*DefaultRetrier).RetryEndpoint(0xc00038a7b8?, {0xa472e0?, 0xc000537db0?}, {0xc00033a090?, 0x415665?}, {0xc0003d4000?, 0x4490f3?}, {0xc0003247a0?, 0xc00038a4f8?}, 0xc0004fde30, ...)
	/go/src/github.com/Comcast/eel/util/defaultretrier.go:28 +0x65
github.com/Comcast/eel/jtl.(*HttpPublisher).Publish(0xc00039ab40)
	/go/src/github.com/Comcast/eel/jtl/httppublisher.go:60 +0xc3
github.com/Comcast/eel/jtl.handleEvent.func1.1({0xa472e0?, 0xc000537e00}, {0xa47368, 0xc00039ab40})
	/go/src/github.com/Comcast/eel/jtl/outproc.go:149 +0x102
created by github.com/Comcast/eel/jtl.handleEvent.func1
	/go/src/github.com/Comcast/eel/jtl/outproc.go:146 +0x25e5

goroutine 512948 [select]:
net/http.(*persistConn).writeLoop(0xc0003cfd40)
	/usr/local/go/src/net/http/transport.go:2392 +0xf5
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1751 +0x1791

goroutine 512941 [select]:
net/http.(*Transport).getConn(0xc00035e000, 0xc0005fec00, {{}, 0x0, {0xc00033a090, 0x4}, {0xc000333548, 0x12}, 0x0})
	/usr/local/go/src/net/http/transport.go:1375 +0x5c6
net/http.(*Transport).roundTrip(0xc00035e000, 0xc000419700)
	/usr/local/go/src/net/http/transport.go:581 +0x76f
net/http.(*Transport).RoundTrip(0xc000419700?, 0xa42220?)
	/usr/local/go/src/net/http/roundtrip.go:17 +0x19
net/http.send(0xc000419600, {0xa42220, 0xc00035e000}, {0x94c840?, 0x4cad01?, 0xd07a40?})
	/usr/local/go/src/net/http/client.go:252 +0x5d8
net/http.(*Client).send(0xc00030c540, 0xc000419600, {0xc000055400?, 0xc0005410e0?, 0xd07a40?})
	/usr/local/go/src/net/http/client.go:176 +0x9b
net/http.(*Client).do(0xc00030c540, 0xc000419600)
	/usr/local/go/src/net/http/client.go:725 +0x8f5
net/http.(*Client).Do(...)
	/usr/local/go/src/net/http/client.go:593
github.com/Comcast/eel/util.HitEndpoint({0xa472e0, 0xc000590820}, {0xc00033a090, 0x2f}, {0xc00024f900, 0x4a6}, {0xc0003247a0, 0x4}, 0xc0004833e0, 0x0)
	/go/src/github.com/Comcast/eel/util/http.go:155 +0xb45
github.com/Comcast/eel/util.(*DefaultRetrier).Retry(0x60, {0xa472e0, 0xc000590820}, {0xc00033a090, 0x2f}, {0xc00024f900, 0x4a6}, {0xc0003247a0, 0x4}, 0xc0004833e0, ...)
	/go/src/github.com/Comcast/eel/util/defaultretrier.go:39 +0x1a7
github.com/Comcast/eel/util.(*DefaultRetrier).RetryEndpoint(0xc00011a7b8?, {0xa472e0?, 0xc000590820?}, {0xc00033a090?, 0x415665?}, {0xc00024f900?, 0x4490f3?}, {0xc0003247a0?, 0xc00011a4f8?}, 0xc0004833e0, ...)
	/go/src/github.com/Comcast/eel/util/defaultretrier.go:28 +0x65
github.com/Comcast/eel/jtl.(*HttpPublisher).Publish(0xc00023cb40)
	/go/src/github.com/Comcast/eel/jtl/httppublisher.go:60 +0xc3
github.com/Comcast/eel/jtl.handleEvent.func1.1({0xa472e0?, 0xc000590870}, {0xa47368, 0xc00023cb40})
	/go/src/github.com/Comcast/eel/jtl/outproc.go:149 +0x102
created by github.com/Comcast/eel/jtl.handleEvent.func1
	/go/src/github.com/Comcast/eel/jtl/outproc.go:146 +0x25e5

goroutine 512860 [IO wait]:
internal/poll.runtime_pollWait(0x7f00fe1d8648, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc000600480?, 0xc000482c11?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc000600480, {0xc000482c11, 0x1, 0x1})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc000600480, {0xc000482c11?, 0xc000286118?, 0xc000116768?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000562000, {0xc000482c11?, 0xc0006a6fa0?, 0xc0001de4e0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc000482c00)
	/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:668 +0xca

goroutine 512947 [IO wait]:
internal/poll.runtime_pollWait(0x7f00fe1d8af8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc000314480?, 0xc0003cb000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc000314480, {0xc0003cb000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc000314480, {0xc0003cb000?, 0x1?, 0xc00033a0a5?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000326230, {0xc0003cb000?, 0x0?, 0xc00038a510?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*persistConn).Read(0xc0003cfd40, {0xc0003cb000?, 0x4070dd?, 0x60?})
	/usr/local/go/src/net/http/transport.go:1929 +0x4e
bufio.(*Reader).fill(0xc00075f6e0)
	/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).Peek(0xc00075f6e0, 0x1)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
net/http.(*persistConn).readLoop(0xc0003cfd40)
	/usr/local/go/src/net/http/transport.go:2093 +0x1ac
created by net/http.(*Transport).dialConn
	/usr/local/go/src/net/http/transport.go:1750 +0x173e

goroutine 512942 [IO wait]:
internal/poll.runtime_pollWait(0x7f00fe13dca0, 0x77)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc000601180?, 0x95c1ae?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitWrite(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).WaitWrite(...)
	/usr/local/go/src/internal/poll/fd_unix.go:741
net.(*netFD).connect(0xc000601180, {0xa458b8?, 0xc0000c0020}, {0xc00049d370?, 0x40ef65?}, {0xa42660?, 0xc000029140?})
	/usr/local/go/src/net/fd_unix.go:141 +0x716
net.(*netFD).dial(0xc000601180, {0xa458b8, 0xc0000c0020}, {0xa462e0?, 0x0?}, {0xa462e0?, 0xc000483c50}, 0x0?)
	/usr/local/go/src/net/sock_posix.go:149 +0x394
net.socket({0xa458b8, 0xc0000c0020}, {0x95c1ae, 0x3}, 0x2, 0x1, 0x0?, 0x60?, {0xa462e0, 0x0}, ...)
	/usr/local/go/src/net/sock_posix.go:70 +0x2b2
net.internetSocket({0xa458b8, 0xc0000c0020}, {0x95c1ae, 0x3}, {0xa462e0, 0x0}, {0xa462e0, 0xc000483c50}, 0xc0004df760?, 0x0, ...)
	/usr/local/go/src/net/ipsock_posix.go:142 +0xf8
net.(*sysDialer).doDialTCP(0xc000601100, {0xa458b8, 0xc0000c0020}, 0x0, 0xd?)
	/usr/local/go/src/net/tcpsock_posix.go:65 +0xa5
net.(*sysDialer).dialTCP(0x1?, {0xa458b8?, 0xc0000c0020?}, 0x4cad96?, 0xc0005c55f0?)
	/usr/local/go/src/net/tcpsock_posix.go:61 +0x59
net.(*sysDialer).dialSingle(0xc000601100, {0xa458b8, 0xc0000c0020}, {0xa43ea8?, 0xc000483c50})
	/usr/local/go/src/net/dial.go:583 +0x28b
net.(*sysDialer).dialSerial(0xc000601100, {0xa458b8, 0xc0000c0020}, {0xc000511d50?, 0x1, 0x95c5e1?})
	/usr/local/go/src/net/dial.go:551 +0x312
net.(*Dialer).DialContext(0xc0003221e0, {0xa458b8, 0xc0000c0020}, {0x95c1ae, 0x3}, {0xc000333548, 0x12})
	/usr/local/go/src/net/dial.go:428 +0x736
net.(*Dialer).Dial(0x7f00fe0cf060?, {0x95c1ae?, 0x12504c5b8?}, {0xc000333548?, 0x118?})
	/usr/local/go/src/net/dial.go:351 +0x45
net/http.(*Transport).dial(0x9137076f19a24fbe?, {0xa458f0?, 0xc000799e00?}, {0x95c1ae?, 0xc000511c60?}, {0xc000333548?, 0xc000419600?})
	/usr/local/go/src/net/http/transport.go:1172 +0x5a
net/http.(*Transport).dialConn(0xc00035e000, {0xa458f0, 0xc000799e00}, {{}, 0x0, {0xc00033a090, 0x4}, {0xc000333548, 0x12}, 0x0})
	/usr/local/go/src/net/http/transport.go:1607 +0x83f
net/http.(*Transport).dialConnFor(0xa47368?, 0xc0000d44d0)
	/usr/local/go/src/net/http/transport.go:1449 +0xb0
created by net/http.(*Transport).queueForDial
	/usr/local/go/src/net/http/transport.go:1418 +0x3d2

goroutine 512861 [chan send]:
github.com/Comcast/eel/jtl.(*lexer).emit(...)
	/go/src/github.com/Comcast/eel/jtl/lexer.go:158
github.com/Comcast/eel/jtl.lexText(0xc00002f000)
	/go/src/github.com/Comcast/eel/jtl/lexer.go:201 +0x30f
github.com/Comcast/eel/jtl.(*lexer).run(0xc00002f000)
	/go/src/github.com/Comcast/eel/jtl/lexer.go:141 +0x2a
created by github.com/Comcast/eel/jtl.lex
	/go/src/github.com/Comcast/eel/jtl/lexer.go:134 +0xf8
{"app.id":"eel","debug_action":"event_after_transformation","destination":"unknown","env.name":"default","gears.app.id":"tenant1","gears.partner.id":"","handler":"oura-to-dgraph","instance.id":"oura-2-dgraph-etl-5b7bfc9448-gjpvl","log.id":"dc9c18bf-d5a2-40e5-8f59-0c9091c851c5","log.level":"debug","log.timestamp":"2022-04-22T15:41:07.491325766Z","payload":{"set":{"context":{"block_hash":"be342e54bc765e74ed04fd51850d9fd86abf8799807657db8ecfd32841d15aa9","block_number":5058097,"certificate_idx":null,"input_idx":null,"output_address":null,"output_idx":null,"slot":16009473,"timestamp":1607575764,"tx_hash":"ff9c00eefe24cf99d19dc5e1b405f8d3b71c4d18afb95ca2ed150daf4c936a9f","tx_idx":1},"fingerprint":"16009473.tx.175673335737938583721856672132598484816","timestamp":1607575764000,"transaction":{"fee":186276,"hash":"ff9c00eefe24cf99d19dc5e1b405f8d3b71c4d18afb95ca2ed150daf4c936a9f","input_count":1,"inputs":[{"index":0,"tx_id":"a08daab5ef88fbaaf4b869ceb2e94ba17ccda4ebc5f874bc0eb67217bf7db136"}],"metadata":null,"mint":null,"mint_count":0,"network_id":null,"output_count":1,"outputs":[{"address":"addr1qy8rdzdyv0c7j2yhnraxqxjt0t0l6nwxa0xnja4v0vjkq2vxal9tylsn3za5s72ulkv9zf6nwyp2hel82lht689cxucqa8a6ey","amount":12726539187,"assets":[]}],"total_output":12726539187,"ttl":16012994,"validity_interval_start":null},"variant":"Transaction"}},"topic":"","tx.traceId":"dc9c18bf-d5a2-40e5-8f59-0c9091c851c5"}

How to extract

I have such an input : {"method":"getbalance","params":["*",4],"id":8}. How to extract the second element of "params", i.e. the number "4" ?

Remove object from every response

I have a very basic requirement for eel to act as a proxy and simply filter out a particular object for every JSON response from a server and pass it back to client.

Just like this:

./eel -in='{"items":[{"asset_id":8001,"db_id":111300,"pdb_id":1180,"pdb_name":"TEST1","purchased_gb":500,"allocated_gb":295,"used_gb":246},{"asset_id":7945,"db_id":111300,"pdb_id":1161,"pdb_name":"TEST2","purchased_gb":100,"allocated_gb":10,"used_gb":7}]}' -tf='{"{{/}}": "{{/items}}"}' -istbe=false

However, I can't see to get the configuration working. Appreciate any pointers, thanks.

Is there such thing as "try..catch" ?

I need to select a transformation based on a request value, and if there is no match there should be a special "bypass" transformation. Is it possible ?

Multiple elements arrays howto ?

Is there an example how to transform complex json documents with multiple elements, for example such one:

"result":[
{
"balance":{
"amount": 0,
"assets":[
{
"name": "RURT",
"assetref": "18-265-55833",
"qty": 94
}
]
},
"myaddresses":["1Gcv7PgJX8kg2zd6SMYq2shotah9H94r7bc61s"],
"addresses":["1X6XtK85XBUCs5H8m7hqzAbpmFWVJyfYeBR6C4"],
"permissions":[],
"items":[],
"data":[],
"confirmations": 22,
"blockhash": "000be156594897acd8f5e9c68249673438cf8e0d5f6f7859e0a88035f88be067",
"blockindex": 1,
"blocktime": 1530763252,
"txid": "86b933e10c91cec316fb2b0755551aafad8323e32f5cccb239a5b7f9f08ae8a6",
"valid": true,
"time": 1530763252,
"timereceived": 1530772271
},
{
"balance":{
"amount": 0,
"assets":[
{
"name": "RURT",
"assetref": "18-265-55833",
"qty": 57
}
]
},
"myaddresses":["1DfitzueRPd1j4huBat6ppQVNKY2jEsFsm9sMW"],
"addresses":["1X6XtK85XBUCs5H8m7hqzAbpmFWVJyfYeBR6C4"],
"permissions":[],
"items":[],
"data":[],
"confirmations": 11,
"blockhash": "00b531dccf9bd9332ee2d1b36a037a6eb6d1eb2d5938fdc9c7b46ee6923792d7",
"blockindex": 1,
"blocktime": 1537977604,
"txid": "9346498d4bce423e7e34589d83667ae251f5b3be8eefdb4565490761dcd7a966",
"valid": true,
"time": 1537977592,
"timereceived": 1537977592
}
],
"error": null,
"id": 2
}

Need help on both request & responce transformation

Hello,
I have a rather special case: it is necessary to send a http request with a json post header from client to eel, transform it, forward it to server, wait for a response (json), transform it & return it to the client. Could you guide me how to do it best with eel ? Thanks

Insert root element into an array

Aloha!

First of all, thanks for building such a useful tool ๐Ÿ™

I'm trying to figure out how to transform a payload that looks like this in.json [0] into something like this out.json [1]. It's basically reparenting {{/}} within an array into a new, different object which I assumed would be easy peasy, but after having read all the examples and doc regarding transformations and functions, I've been unable to figure out how to do so ๐Ÿ˜“

Could you lend me a hand? Thanks in advance!

[0]

{ "context": { "foo": "bar" } }

[1]

{ "set": [ { "context": { "foo": "bar" } } ] }

How-to questions on submitting pull-requests

Hi! To submit a pull-request, I seem to be needing an XRULES-number if I follow the PR template. And I need to submit a signed CLA.pdf form. Questions: How do I get that X number, and where to send the signed form? And should I submit my PR against your dev branch or master? Thanks for the info!

Headers problem

I take headers from the request & put them into curl (the upstream requires basic auth), but the upstream returns 401, despite the login&password is absolutely correct (direct connect from client to upstream works correct, if client connects to upstrem through EEL - the upstream returns 401)

Docker build error

I becomes a error
jtl/functions.go:1120: undefined: strings.ReplaceAll

One handler or many handlers ?

I need to perform completely different transformations, based on the incoming POST request. Sould I better make several handlers, or put everything in a single default.json file ?

-config flag listed as optional, is actually required

./eelsys -h produces

  -config string
    	path to config.json (optional)

however

./eelsys produces

{ "error" : "open config-eel/config.json: no such file or directory" }{"cause":"open_config","error":"open config-eel/config.json: no such file or directory","error_type":"get_config","log.id":"","log.level":"error","log.timestamp":"2017-01-18T03:44:02.080403207Z"}

but

./eelsys -config ../../config-eel/config.json

works correctly

Engraved in code transformation.

Hi. First of all thank you for this project! It is awesome!

From the README:

The downside is that transformations become engraved in code and cannot be changed easily.

Are there any plans to make transformations updatable (e.g. via HTTP call)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.