https://github.com/jrcichra/ingestd
HTTP server that easily ingests data into a database
https://github.com/jrcichra/ingestd
data gin hacktoberfest ingest ingestion restful-api
Last synced: about 2 months ago
JSON representation
HTTP server that easily ingests data into a database
- Host: GitHub
- URL: https://github.com/jrcichra/ingestd
- Owner: jrcichra
- License: mit
- Created: 2020-09-22T03:17:46.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2026-04-01T01:43:43.000Z (3 months ago)
- Last Synced: 2026-04-01T04:11:51.804Z (3 months ago)
- Topics: data, gin, hacktoberfest, ingest, ingestion, restful-api
- Language: Go
- Homepage:
- Size: 387 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ingestd
+ HTTP server that easily ingests data into a database (powered by [gin](https://github.com/gin-gonic/gin)!)
+ Just POST JSON to http://hostname:port/database/table
# Usage
+ Specify your database credentials and other options in `config-example.txt`. See it for an example.
## Binary
+ Run `make`. Put the config.txt file in the same directory as the binary
## Container
+ Run the container, mapping in the config file with the credentials:
```
docker run -it -d \
--name=ingestd \
--hostname=ingestd \
--restart=unless-stopped \
-v ${PWD}/config.txt:/ingestd/config.txt \
-p 8080:8080 \
jrcichra/ingestd
```
+ Try simple GET to make sure gin is up:
```
$ curl http://hostname:port/ping
{"message":"pong"}
$
```
+ Make a POST call (i.e cURL) - see [post.sh](post.sh):
```
curl -i --header "Content-Type: application/json" \
--request POST \
--data "{"col1": "value1", "col2": "value2"}" \
http://hostname:port/database/table
```
Form the URL and JSON payload to match your database schema.
If the insert was successful, the HTTP server will return an empty 200 OK response. Any other issue will return a 500 with a JSON body of the server-side error.
# Todo
+ Mutliplexing databases