https://github.com/skilld-labs/http-event-adapter
https://github.com/skilld-labs/http-event-adapter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/skilld-labs/http-event-adapter
- Owner: skilld-labs
- Created: 2020-11-27T15:47:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T07:20:21.000Z (about 1 year ago)
- Last Synced: 2025-03-13T07:02:26.618Z (3 months ago)
- Language: Go
- Size: 13.9 MB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http-event-adapter
Generic way to send business events inside sink
It simply listen from HTTP requests and using gotemplate, transform request, and send the output data inside a sink.
All is configurable, contribution opened :)## Supported format
- csv
- yaml
- json## Writers
- fmt
- nats (to do)## Examples
```
curl --data-binary "@examples/example.json" -X POST http://localhost:8081/json
curl --data-binary "@examples/example.csv" -X POST http://localhost:8081/csv
curl --data-binary "@examples/example.yaml" -X POST http://localhost:8081/yaml
```those requests use examples/person.tmpl as template (see configuration below)
## Configuration
```go
type EventConfiguration struct {
InputFormat string `config:"inputFormat"` // (json/yaml/csv)
OutputTemplate string `config:"outputTemplate"` // (path of the template file)
OutputWriter string `config:"outputWriter"` (fmt/nats)
OutputChannel string `config:"outputChannel"` (the path of the output channel / can be templatize)
SingleOutputEvent bool `config:"singleOutputEvent"` (set true if one http request == one output event, default to false)
ChrootPath string `config:"chrootPath"` (not implemented)
ExtendedFunctions map[string][]string `config:"extendedFunctions"` (specify informations for extended functions. key is link for the so file, values are all exporter functions you want to use in templates)
}
```## TODO
- one separator per csv route