{"repo":"monzo/typhon","free":true,"listed":false,"github":"https://github.com/monzo/typhon","clone":"git clone https://github.com/monzo/typhon.git","description":"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.","language":"Go","stars":788,"topics":["go","rpc","microservices","http","golang"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Typhon 🐲 Typhon is a wrapper around Go's [ net/http ] library that we use at Monzo to build RPC servers and clients in [our microservices platform][platform blog post]. It provides a number of conveniences and tries to promote safety wherever possible. Here's a short list of interesting features in Typhon: No need to close body.Close() in clients Forgetting to body.Close() in a client when the body has been dealt with is a common source of resource leaks in Go programs in our experience. Typhon ensures that – unless you're doing something really weird with the body – it will be closed automatically. Middleware \"filters\" Filters are decorators around Service s; in Typhon servers and clients share common functionality by composing it functionally. Body encoding and decoding Marshalling and unmarshalling request bodies to structs is such a common operation that our Request and Response objects support them directly. If the operations fail, the errors are propagated automatically since that's nearly always what a server will want. Propagation of cancellation When a server has done handling a request, the request's context is automatically cancelled, and these cancellations are propagated through the distributed call stack. This lets downstream servers conserve work producing responses that are no longer needed. Error propagation Responses have an inbuilt Error attribute, and serialisation/deserialisation of these errors into HTTP errors is taken care of automatically. We recomme","default_branch":null,"files":null,"tree":[],"storefront":"/r/monzo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/monzo/typhon/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}