Commit Graph
10 Commits
Author SHA1 Message Date
Anton Kaliaev 956966e658 add missing validator package to glide.yaml 2017-08-11 16:36:26 -04:00
Emmanuel Odeke d67a621715 http: http-utils added after extraction
Found common http utils that were being multiply duplicated across
many libraries and since am moving things in basecoin/unstable to
add for more functionality, it's better to put them in one
place.

Utilities and tests added:
- [X] FparseJSON
- [X] FparseAndValidateJSON
- [X] ParseRequestJSON
- [X] ParseAndValidateRequestJSON
- [X] WriteCode
- [X] WriteError
- [X] WriteSuccess
- [X] ErrorResponse

During review from @ethanfrey, made updates:
* Removed tt.want since it was a distraction/artifact that made
the reviewer think the tests weren't testing for both failed
and passed results.
* Added ErrorWithCode as WithCode is a common options pattern
in Go that could cause confusion:
  ErrorWithCode(error, int) ErrorResponse
* Using json.NewDecoder(io.Reader) error instead of
ioutil.ReadAll(io.Reader) to slurp all the bytes.
* Added more test scenarios to achieve 100% coverage of http.go
2017-08-02 11:38:52 -06:00
Ethan Buchman 3c6c1b7d33 common: ProtocolAndAddress 2017-07-19 15:02:04 -04:00
rigel rozanski cc364b14e2 changelog and PR changes 2017-06-20 17:18:55 -04:00
rigel rozanski f913ed8134 date simplify 2017-06-06 16:08:57 -04:00
rigel rozanski 304be4ec2f date parse functionality 2017-06-06 04:00:36 -04:00
rigel rozanski 925f2b3350 golint corrections 2017-06-05 16:22:01 -04:00
rigel rozanski 295f6c2cc6 IsHex and StripHex 2017-06-05 15:50:11 -04:00
Anton Kaliaev ed76afd409 Logger interface and tmLogger impl based on go-kit 2017-05-05 21:43:07 +04:00
Ethan Buchman 356657a37b move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00