https://github.com/softonic/hp-passthrough
Dummy middleware for homing pigeon
https://github.com/softonic/hp-passthrough
homing-pigeon hp-middleware
Last synced: about 1 year ago
JSON representation
Dummy middleware for homing pigeon
- Host: GitHub
- URL: https://github.com/softonic/hp-passthrough
- Owner: softonic
- License: other
- Created: 2019-12-12T11:33:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-16T08:54:59.000Z (over 6 years ago)
- Last Synced: 2024-04-15T09:21:20.704Z (about 2 years ago)
- Topics: homing-pigeon, hp-middleware
- Language: Go
- Size: 43 KB
- Stars: 1
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# HP Passthrough Middleware
[Homing pigeon](https://github.com/softonic/homing-pigeon) middleware that just pass the data.
### Overview
This dummy middleware can be used as base middleware to do your own implementations.
### Requirements
All the [Homing pigeon](https://github.com/softonic/homing-pigeon) middlewares must accept at least the next env vars.
| Name | Description | Example |
| ---------- | ------------------------------------------ | ------------------------------------------------------------------------------------ |
| IN_SOCKET | Socket where the data will be received | `"/sockets/input.sock"` |
| OUT_SOCKET | Socket to send data to the next middleware | `"passthrough:///unix:///sockets/input.sock"` or `""` if this is the last middleware |
### How it works
The middleware receives a `github.com/softonic/homing-pigeon/middleware` message as request in the `IN_SOCKET`, so you can
modify the input data to send it to the next middlewares. After the next middlewares are executed, it intercepts the response
so it can be modified again before it is finally returned.
The main homing-pigeon package come with an `UnimplementedMiddleware` to allow you to implement just the middleware bussiness logic. If you need
more control, you can implement your middleware from scratch. Take a look at `UnimplementedMiddleware` to know the basic implementation.
### Usage
You just need to execute the binary or use docker to automatically run it. If you want to show some logging in the output, you can use the [kglog](https://github.com/kubernetes/klog) flags in the command.