Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T12:10:47.000Z (2 months ago)
- Last Synced: 2024-10-18T03:54:06.643Z (2 months ago)
- Topics: data, gin, hacktoberfest, ingest, ingestion, restful-api
- Language: Go
- Homepage:
- Size: 646 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
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