typhon
typhon copied to clipboard
A wrapper around Go's net/http to provide safety and convenience. At Monzo, Typhon forms the basis of most clients and servers in our microservices platform.
When I first read filter I imagined it altered incoming requests, but it also can alter outgoing requests. I added some extra sentences so in the future people might not...
iam getting responce like this {"code":"bad_request.foo","message":"Invalid or Inactive webform","stack":[{"filename":"/home/anirudh/mailercloud_form_tracker/main.go","line":17,"method":"main.testerror"},{"filename":"github.com/monzo/[email protected]/router.go","line":127,"method":"typhon.Router.Serve.func1"},{"filename":"github.com/monzo/[email protected]/errors.go","line":65,"method":"typhon.ErrorFilter"},{"filename":"github.com/monzo/[email protected]/service.go","line":10,"method":"typhon.Service.Filter.func1"},{"filename":"github.com/monzo/[email protected]/server.go","line":82,"method":"typhon.Serve.func1"},{"filename":"github.com/monzo/[email protected]/service.go","line":10,"method":"typhon.Service.Filter.func1"},{"filename":"github.com/monzo/[email protected]/http.go","line":95,"method":"typhon.HttpHandler.func1"},{"filename":"/usr/lib/golang/src/net/http/server.go","line":2042,"method":"http.HandlerFunc.ServeHTTP"},{"filename":"/usr/lib/golang/src/net/http/server.go","line":2843,"method":"http.serverHandler.ServeHTTP"},{"filename":"/usr/lib/golang/src/net/http/server.go","line":1925,"method":"http.(*conn).serve"},{"filename":"/usr/lib/golang/src/runtime/asm_amd64.s","line":1374,"method":"runtime.goexit"}],"retryable":{}}
I was looking at the codebase and thinking if I can make some part a bit nicer. Here is my first attempt. I have: - added unit tests for `ErrorFilter`...
This Code Base Helps when working with text/template and reading form request. Code Base Dependency are core libs only. Usage.md File is an attempt to Explain the basics.
One common pitfall of using typhon.NewRequest for standard HTTP usage is that it's easy to try and use it like a regular http.NewRequest and pass in a raw body, expecting...
This PR exports the errors.Status2TerrCode function. It is currently unexported, and also unused. I'd like to export this as it is useful for implementing custom error filters, for example, when...
A small thing, but we are now required to import 2 versions of the set library because the latest breaks Typhon.
Fixes possible `nil` pointer dereference in `dynamicRoundTripper.RoundTrip()`. If this PR needs tests I would like some assistance with that. It doesn't really seem to fit into the current flavor testing...
When an URL is provided without a schema or a completely invalid URL an error should be returned. The current behavior is a panic from `dynamicRountTripper.RoundTrip()` Example URL's - 127.0.0.1:80/test...
We don't want to be stuck on older versions for CI