Augusto Dwenger
7c0e51ad48
Merge branch 'develop'
...
Add middleware tests
Fix inMemDB insertion bug -> Not taking the correct hostname
Fix data races produced by the db
Improve parameter/argument parsing
Add env variables parsing
Add Dockerfile
2020-11-11 16:25:54 +01:00
Augusto Dwenger
3874593a8d
Update README.md TODOs
...
Configuration through env vars is now possible.
2020-11-11 16:24:26 +01:00
Augusto Dwenger
771ce66ce2
Add mechanism to return a copy of the original slice
...
This is to prevent further data races.
2020-11-11 16:21:15 +01:00
Augusto Dwenger
c997dbaf22
Fix inMemDB data races
...
All calls to the inMemDB are now synced.
2020-11-11 12:28:11 +01:00
Augusto Dwenger
461f4b4c94
Add required flag for the token
...
The default flag parsing engine from go was replaced by the the package
github.com/gessevdk/go-flags. It provides more options to parse flags
from the program args and from env vars.
2020-11-11 11:01:13 +01:00
Augusto Dwenger
0813994589
Add vscode directory to ignore
2020-11-11 10:41:43 +01:00
Augusto Dwenger
6d9049820f
Fix db returning not the newst stats
...
Getting stats for a host returned allways the oldest item.
Now inserting an item stores it at the beginning of the list ->
without changing the getting stategy it will now return the newst item.
2020-11-11 10:25:59 +01:00
Augusto Dwenger
131a71620d
Fix insertion error
...
It woudn't use the hostname from the func params.
2020-11-10 19:07:22 +01:00
Augusto Dwenger
4eafabc465
Add more fields to the Stats struct
...
Add json serialization information
Add one complete data example to the db init script
2020-11-06 09:33:08 +01:00
Augusto Dwenger
efb9d7aace
Change docker base image to alpine
...
It reduces the image by >100MB.
2020-11-03 15:32:49 +01:00
Augusto Dwenger
8a75d06913
Add Dockerfile
2020-11-02 15:56:40 +01:00
Augusto Dwenger
6ce7d15af9
Add test to the auth middleware
2020-10-30 14:41:15 +01:00
Augusto Dwenger
cf9b72970b
Merge branch 'develop' into master
...
Implement middlewares -> logging, panic/recover and auth
Fix Host controller errors
2020-10-30 12:22:10 +01:00
Augusto Dwenger
3f6a54a4e3
Update README.md
...
Checked the auth middelware todo.
2020-10-30 12:20:41 +01:00
Augusto Dwenger
b07ffc5f7e
Impement auth middleware
...
The middleware checks for the presents of a 'Token' header and
if the provided token is valid. It adds a authorization layer with
some basic configuration options.
2020-10-30 12:18:26 +01:00
Augusto Dwenger
2ae33c6e1b
Add default middlewares
...
Add request logging middleware
Add panic recover middleware
2020-10-30 11:31:57 +01:00
Augusto Dwenger
f61cd0ad83
Set verbose log level to trace
2020-10-30 10:32:11 +01:00
Augusto Dwenger
6ac85cc2a8
Change testing from assertion to require
...
The benefit of require is that on a fail it will stop the test
execution.
2020-10-27 12:07:52 +01:00
Augusto Dwenger
d6158dbe37
Add timeout for idle connections
2020-10-27 12:07:30 +01:00
Augusto Dwenger
96f1638564
Merge branch 'feature/hosts-testing' into develop
...
Add CI/CD pipeline with drone ci
Add application logging
Add flags to configure the server
2020-10-26 22:37:15 +01:00
Augusto Dwenger
445055c332
Add error better handling for PostStats func
2020-10-26 22:29:57 +01:00
Augusto Dwenger
d4bcc3d453
Change error message in GetStats
...
Add more tests.
2020-10-26 21:51:54 +01:00
Augusto Dwenger
1661266f9e
Fix if an unknown error happens getting the host information
...
The function will now exit earlier and write an 500 status code
with the error message to the response.
2020-10-24 17:51:11 +02:00
Augusto Dwenger
c550341eb9
Add error response if pagination query is negative
2020-10-24 12:16:02 +02:00
Augusto Dwenger
b8f6a1a65b
Add first test for GetHosts -> proof of concept
...
Implementing first http test.
2020-10-20 21:01:53 +02:00
Augusto Dwenger
f02ef31225
Add CI/CD pipeline status badge
2020-10-19 17:44:44 +02:00
Augusto Dwenger
2aa6a84854
Create .drone.yml
2020-10-19 17:40:40 +02:00
Augusto Dwenger
7f817e166f
Implement logrus for logging
...
Fix wrong error handling if host was not found getting the stats for it.
Add configuration flags to configure the logging.
2020-10-18 19:01:40 +02:00
Augusto Dwenger
3dfb18f67d
Change returned status code to 201
2020-10-18 17:02:10 +02:00
Augusto Dwenger
092739985c
Implement flag to change the http port
2020-10-18 16:40:34 +02:00
Augusto Dwenger
01fcd41b94
Add some To-Do's to the README.md
2020-10-18 15:52:19 +02:00
Augusto Dwenger
f8dea66ada
Add some To-Do's to the README.md
2020-10-18 15:49:58 +02:00
Augusto Dwenger
44897b3b5a
Implement the hosts controller
...
Simple interaction with the db like getting some data and inserting
new data points into it.
2020-10-18 15:38:57 +02:00
Augusto Dwenger
cc663128f4
Implement in memory db for development
2020-10-16 17:38:30 +02:00
Augusto Dwenger
b661972795
Add project context
2020-10-13 21:03:21 +02:00
Augusto Dwenger
1bdc4deeca
Initial commit
2020-09-24 21:42:03 +02:00