https://github.com/srvaroa/jsonrouter
https://github.com/srvaroa/jsonrouter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/srvaroa/jsonrouter
- Owner: srvaroa
- Created: 2019-06-05T20:57:56.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-15T17:52:34.000Z (about 7 years ago)
- Last Synced: 2025-02-21T15:50:29.270Z (over 1 year ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JsonRouter
==========
JSON Router is a simple library to construct a routing table mapping
[JsonPath](http://jsonpath.com/) expressions to target strings.
Check [samples/config.json]() contains an example configuration of the
routing table.
The CLI reads a JSON from STDIN and takes a routing table from a
configuration file. To invoke it:
cat samples/data.json | go run cmd/main.go -routes=samples/config.json
## Use cases
Connect an event stream to multiple FAAS endpoints that handle a subset
of the events in the stream.
In this case, the targets would be each endpoint URI. JsonRouter allows
defining a set of routes based on the JSON payload. If the event's
payload matches a route, it can be forwarded to the target.