https://github.com/roundpartner/tempus
Micro Service for generating time based keys
https://github.com/roundpartner/tempus
Last synced: 10 months ago
JSON representation
Micro Service for generating time based keys
- Host: GitHub
- URL: https://github.com/roundpartner/tempus
- Owner: roundpartner
- License: mit
- Created: 2017-11-19T15:58:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-06T16:17:36.000Z (about 4 years ago)
- Last Synced: 2025-07-25T18:00:54.831Z (11 months ago)
- Language: Go
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tempus
Micro Service for generating time based keys
## Abstract
This service provides an end point for generating a new token that can be used to authenticate a user.
# Usage
```bash
curl localhost:7373 -d "{\"user_id\":\"1\",\"scenario\":\"test\"}"
```
```json
{"user_id":"1","scenario":"test","token":"2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7"}
```
```bash
curl localhost:7373/1/2b73bb3213da2f0627f492b741bdeb491a43d0f392176981e4138924147ca0d7
```
```json
{"user_id":"1","scenario":"test","token":"BAa-gqpESzJMy6k-oxiokPk-oJ-sejqzgmdSQ0pHXdz3dwTg9wXImWT3_hBKyhgS"}
```
# Testing
You will need redis to run tests
## Starting Redis
Redis can be run locally in a container with
```bash
docker run --rm --name tempus-redis -p 127.0.0.1:6379:6379 redis
```
You can then monitor the server with
```bash
docker exec tempus-redis redis-cli monitor
```
# Benchmarking
```bash
go test -bench=.
```