pancho horrillo
7ea43048bc
Add missing comments
2019-11-20 07:14:00 +01:00
pancho horrillo
75b0908b16
Rename GetReasonFromBody() to simply Reason()
...
See ¹ for the customary idiomatic way of naming getters in Go.
¹: https://golang.org/doc/effective_go.html#Getters
2019-11-20 05:04:10 +01:00
pancho horrillo
3a47b34bc1
Drop stale GetReason() and associated tests
2019-11-20 04:54:07 +01:00
pancho horrillo
b40f73115f
Add missing comment to GetReasonFromBody()
2019-11-20 04:51:29 +01:00
pancho horrillo
81c677c3be
internal/http/request.go: replace GetReason() with GetReasonFromBody()
...
Update tests to inject the required JSON error body with reason.
2019-11-19 21:17:49 +01:00
pancho horrillo
e7619238ae
Add GetReasonFromBody() that extracts reason from JSON
2019-11-19 21:17:34 +01:00
pancho horrillo
83e4523dc7
Simplify files via gofmt -s (thanks, Go Report Card!)
2019-11-19 14:14:55 +01:00
pancho horrillo
92fbb72735
Fix typos catched via misspell (thanks Go Report Card!)
2019-11-19 14:07:58 +01:00
Héctor Hurtado
7bca5b8577
New error handling added to module resource in package data. Minor coding improvements.
2019-11-18 19:09:55 +01:00
pancho horrillo
1249b23458
Fix case mismatch in error JSON (adding tag)
2019-11-18 17:44:39 +01:00
Héctor Hurtado
4c7eae8ebb
New error handling added to getRequestBody function in data package
2019-11-18 15:01:02 +01:00
Héctor Hurtado
e4b3a4f718
New error handling added to server and decorator module in data package
2019-11-18 14:52:52 +01:00
Héctor Hurtado
edff842c3b
New srverrors package added. New error handling added to control package
2019-11-18 14:32:54 +01:00
pancho horrillo
402bbf00d7
Fix style in comment
2019-11-15 21:00:21 +01:00
Héctor Hurtado
ec788f68c2
Added documentation comments to the control package
2019-11-14 12:10:00 +01:00
pancho horrillo
2d5743af84
Add blank line between legal header and package declaration
...
Otherwise, the legal header is rendered as package documentation.
2019-11-13 18:18:44 +01:00
Héctor Hurtado
19c4e8d482
Changed user server bind address to 0.0.0.0 to allow listen on a container
2019-10-31 15:22:56 +01:00
pancho horrillo
c29a17d7e4
Fix handling of arguments
...
Closes : #67
2019-10-25 18:54:52 +02:00
Héctor Hurtado
26a7b690b7
Verify content type on getRoute method
2019-10-25 09:02:36 +02:00
Héctor Hurtado
a54c6f24a1
Added getRoute to control api
2019-10-24 17:52:03 +02:00
pancho horrillo
b0c16ca684
Validate url_pattern format in control API append operation
...
Closes : #38
Co-authored-by: César Gallego Rodríguez <cesar.gallego.next@bbva.com >
2019-10-24 14:10:58 +02:00
Héctor Hurtado
84a71815e4
FIXES : #44
2019-10-24 10:44:57 +02:00
pancho horrillo
52ae3375a4
Drop stale TODO comment
...
Close #42
2019-10-23 18:52:20 +02:00
pancho horrillo
ae3bd76434
Leverage ioutil.ReadAll() and ioutil.ReadFile() to simplify logic
...
Related to: #46
2019-10-23 18:01:58 +02:00
pancho horrillo
7674725658
Drop TODO line of solved issue
...
Related to #46
2019-10-23 17:59:37 +02:00
Héctor Hurtado
723e4787b3
Added legal header to all Go source files
2019-10-23 13:35:01 +02:00
César Gallego Rodríguez
aa6d59fa56
Fix for - and file adding a route. Move null routes to their own issue.
...
Closes : #46
2019-10-23 13:20:31 +02:00
pancho horrillo
034a5ab677
Fix typo in comment
...
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com >
2019-10-22 16:29:54 +02:00
Roberto Abdelkader Martínez Pérez
d465d10b49
Add missing pattern in data server resource endpoints
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 13:16:06 +02:00
Roberto Abdelkader Martínez Pérez
0762728ef5
Remove unused dependency
2019-10-22 12:24:10 +02:00
Roberto Abdelkader Martínez Pérez
28a0be1d87
Allow kapow server to run without .pow file and non-interactive
...
Co-authored-by: pancho horrillo <pedrofelipe.horrillo@bbva.com >
2019-10-22 11:56:18 +02:00
Roberto Abdelkader Martínez Pérez
fa394ce997
Call server.StartServer() from cmd
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 10:23:12 +02:00
Roberto Abdelkader Martínez Pérez
44a9471a57
Implement server.StartServer() to run all three servers
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 10:22:47 +02:00
Roberto Abdelkader Martínez Pérez
8994b8da8c
Implement Run function for data server.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 10:22:10 +02:00
Roberto Abdelkader Martínez Pérez
6a05b31320
Implement configRouter
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 09:48:58 +02:00
Roberto Abdelkader Martínez Pérez
5eae018ee6
Data server decorators implementation.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 17:54:47 +02:00
Roberto Abdelkader Martínez Pérez
63cd125327
Implement setResponseBody
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 10:25:34 +02:00
Roberto Abdelkader Martínez Pérez
0f8d0266b9
Implement setResponseCookies.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 10:01:34 +02:00
Roberto Abdelkader Martínez Pérez
ffc737d1b7
Pending test for header validation.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 09:26:56 +02:00
pancho horrillo
5bbc341e10
Update internal/cmd/server.go
...
- Honour --bind, --control-bind, --data-bind
- Drop unused params (--interactive, --url, --control-url, --data-url)
- Minimize environment for running the powfile shell script
- Drop debug code
TODO: actual key and cert handling for https
2019-10-20 18:39:50 +02:00
pancho horrillo
341768ace8
internal/cmd/server.go: sort imports
2019-10-20 18:38:29 +02:00
pancho horrillo
bb5843ec35
Fix lowercase ID in human-readable messages
2019-10-20 18:32:46 +02:00
pancho horrillo
d31165c82f
Drop trailing slash in URL to query routes
...
This one slipped through the tests, I think because the automagic handling of
trailing slashes by the net/http muxer.
With it, the command:
$ kapow route list
fails with a 'Not Found'.
2019-10-20 18:20:46 +02:00
Roberto Abdelkader Martínez Pérez
5e2a15b34e
Relax lint error about SA1008 because is actually needed in tests
2019-10-18 23:57:12 +02:00
Roberto Abdelkader Martínez Pérez
304276db47
Fix dummy return. Closes #34
2019-10-18 23:55:25 +02:00
Roberto Abdelkader Martínez Pérez
ecfa3dfa74
WIP implementation of setResponseHeaders
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 14:11:56 +02:00
Roberto Abdelkader Martínez Pérez
03e138396d
Fix mispelled handler name.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 13:15:08 +02:00
Roberto Abdelkader Martínez Pérez
bf791a36c6
Implement setResponseStatus.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 13:07:57 +02:00
Roberto Abdelkader Martínez Pérez
e161e14fd6
Implement getRequestFiles.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 10:06:26 +02:00
Roberto Abdelkader Martínez Pérez
d2427b722c
Implement getRequestFileName
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 09:22:58 +02:00