Browse Source

Merge commit '6300e945dc424281aaf188f150770256bd9e0b87' into HEAD

feature/update-route-registration
Jenkins 3 years ago
committed by Fabian Vowie
parent
commit
6ff86c54d6
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 48
      README.md

48
README.md

@ -10,7 +10,7 @@ Micro-service for file storage and processing written in Go.
## Requirements
- [Go 1.17+](https://go.dev/)
- [*Docker*](https://docs.docker.com/) (optional)
- [_Docker_](https://docs.docker.com/) (optional)
## Setup
@ -56,6 +56,35 @@ go test ./... -v
docker run --rm -v "$PWD":/usr/src/lithium -w /usr/src/lithium golang:1.17 go test ./...
```
## Configuration
Config options can be adjusted via the [`settings.json`](settings.json) file in the root directory.
```json
{
"endpoint": "0.0.0.0:8000",
"token": "changeme",
"rate_limiter": {
"requests_per_minute": 20,
"allowed_burst": 5
},
"storage_provider": {
"type": 0,
"base_path": "assets"
}
}
```
## Rate Limiting
By default, the rate limiting takes place on a per-route basis. When the limit for a specific route is hit, the response will return a status code `429: Too Many Requests`.
| Headers | Explanation |
| --------------------- | -------------------------------- |
| X-Ratelimit-Limit | Allowed requests per minute |
| X-Ratelimit-Remaining | Remaining requests |
| X-Ratelimit-Reset | Seconds until requests replenish |
## API
### `GET` `/`
@ -63,6 +92,7 @@ docker run --rm -v "$PWD":/usr/src/lithium -w /usr/src/lithium golang:1.17 go te
Show application information.
**Required headers**:
```shell
Authorization: Bearer <Token>
```
@ -81,6 +111,7 @@ Authorization: Bearer <Token>
Show pipeline information.
**Required headers**:
```shell
Authorization: Bearer <Token>
```
@ -111,21 +142,6 @@ Authorization: Bearer <Token>
}
```
## Configuration
Config options can be adjusted via the [`settings.json`](settings.json) file in the root directory.
```json
{
"endpoint": "0.0.0.0:8000",
"token": "changeme",
"storage_provider": {
"type": 0,
"base_path": "assets"
}
}
```
## Pipelines
The project uses a pipeline system defined by [JSON](https://en.wikipedia.org/wiki/JSON) files located in the [config](config) folder.

Loading…
Cancel
Save