• Stars
    star
    713
  • Rank 63,511 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.

Typhon 🐲

Build Status GoDoc

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.

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 Services; 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 recommend using this in conjunction with monzo/terrors.

  • Full HTTP/1.1 and HTTP/2.0 support
    Applications implemented using Typhon can communicate over HTTP/1.1 or HTTP/2.0. Typhon has support for full duplex communication under HTTP/2.0, and h2c (HTTP/2.0 over TCP, ie. without TLS) is also supported if required.

More Repositories

1

response

Monzo's real-time incident response and reporting tool ⚡️
JavaScript
1,460
star
2

phosphor

Distributed System Tracing in Go
Go
375
star
3

progression-framework

The Monzo Progression Framework site, built with Gatsby.
JavaScript
291
star
4

egress-operator

A Kubernetes operator to produce egress gateway Envoy pods and control access to them with network policies
Go
233
star
5

envoy-preflight

A wrapper for applications to help with running envoy as a sidecar
Go
134
star
6

docs

Public API documentation
SCSS
101
star
7

calico-accountant

A Prometheus exporter for Calico policy packet counts
Go
87
star
8

terrors

Go
71
star
9

ddbt

Dom's Data Build Tool
Go
70
star
10

file-cleaner

JavaScript
64
star
11

etcd3-terraform

A Terraform recipe for a robust etcd cluster, based on how Monzo runs its clusters. 💪
HCL
46
star
12

slog

Structured logging
Go
46
star
13

mondo-ruby

Ruby Client
Ruby
45
star
14

reference-receipts-app

A simple Monzo third party API client for demonstrating the new Receipts API.
Python
19
star
15

web-exercise

Take-home exercise for web engineer hiring 🚀
11
star
16

kotlin-synthetics-migrator

An Intellij Plugin for migrating an Android app from Kotlin Synthetics to findById
Kotlin
10
star
17

kontrast

Go
10
star
18

phosphord

Trace Forwarding Daemon
Go
9
star
19

phosphor-go

Go client for Phosphor
Go
7
star
20

vault-plugin-database-k8s-controller

A fork of Vault's database credential plugin allowing the use of annotations on service accounts as parameters in statements
Go
7
star
21

etcd3-bootstrap

Bootstraps an etcd3 cluster node
Go
6
star
22

drbd9_exporter

Exports status and metrics of DRBD 9.0 volumes
Go
6
star
23

code-of-conduct

The Monzo Community Code of Conduct
5
star
24

verifiedsms

A go library for interacting with Google Verified SMS
Go
3
star
25

file-score

JavaScript
3
star
26

web-code-test-server

Server for the frontend web dev code test in our interview process
JavaScript
2
star
27

gosquared

A golang gosquared client
Go
2
star
28

Judo-Swift

Judo Swift SDK for Swift 2.0/Xcode 7
Swift
2
star
29

guepacket

GUE (Generic UDP Encapsulation) layer for gopacket 📦
Go
2
star
30

CHCSVParser

Objective-C
1
star
31

libPhoneNumber-iOS

Objective-C
1
star