Skip to content

ofpiyush/twirp

This branch is 216 commits behind twitchtv/twirp:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f7b1717 · Sep 25, 2020
Jan 17, 2018
Mar 14, 2019
Sep 18, 2020
Jan 18, 2018
Sep 25, 2020
Sep 18, 2020
Oct 22, 2019
Sep 18, 2020
Sep 18, 2020
Oct 1, 2018
 
 
Sep 18, 2020
Mar 7, 2019
Nov 6, 2019
Aug 26, 2020
Sep 24, 2018
Jan 26, 2018
Jan 17, 2018
Sep 17, 2020
Jan 17, 2018
Sep 16, 2020
Sep 3, 2020
Jan 19, 2018
Sep 18, 2020
Sep 2, 2020
May 7, 2020
Sep 15, 2020
May 10, 2020
Jun 8, 2020
Sep 14, 2020
Sep 25, 2020
Sep 18, 2020
Jan 18, 2018
Jan 16, 2018
Apr 29, 2019
Sep 17, 2020
Sep 14, 2020
Sep 24, 2018
Jan 30, 2018
Sep 15, 2020

Repository files navigation

Twirp Logo Build Status Go Report Card GoDoc


Twirp is a framework for service-to-service communication emphasizing simplicity and minimalism. It generates routing and serialization from API definition files and lets you focus on your application's logic instead of thinking about folderol like HTTP methods and paths and JSON.

Define your service in a Protobuf file and then Twirp autogenerates Go code with a server interface and fully functional clients. It's similar to gRPC, but without the custom HTTP server and transport implementations: it runs on the standard library's extremely-well-tested-and-high-performance net/http Server. It can run on HTTP 1.1, not just http/2, and supports JSON clients for easy integrations across languages

Twirp handles routing and serialization for you in a well-tested, standardized, thoughtful way so you don't have to. Serialization and deserialization code is error-prone and tricky, and you shouldn't be wasting your time deciding whether it should be "POST /friends/:id/new" or "POST /:id/friend" or whatever. Just get to the real work of building services!

Along the way, you get an autogenerated client and a simple, smart framework for passing error messages. Nice!

For more on the motivation behind Twirp (and a comparison to REST APIs and gRPC), the announcement blog post is a good read.

Installation

Use go get to install the Go client-and-server generator:

go get github.com/twitchtv/twirp/protoc-gen-twirp

You will also need:

Documentation

On the website: https://twitchtv.github.io/twirp/docs/intro.html

Source for this documentation is in the docs subdirectory. The website is generated from that folder using Docusaurus.

Implementations in other languages

This repo only has the official generators, which write out Go and Python (partial, see #185 and #220) code.

For other languages, there are third-party generators available:

Language Clients Servers Repository
Python3 github.com/verloop/twirpy
Java github.com/fajran/protoc-gen-twirp_java_jaxrs
Java https://github.com/devork/flit
JavaScript github.com/thechriswalker/protoc-gen-twirp_js
JavaScript github.com/Xe/twirp-codegens/cmd/protoc-gen-twirp_jsbrowser
Typescript github.com/larrymyers/protoc-gen-twirp_typescript
Ruby github.com/twitchtv/twirp-ruby
Rust github.com/cretz/prost-twirp
Scala github.com/soundcloud/twinagle
Swagger github.com/elliots/protoc-gen-twirp_swagger
PHP github.com/twirphp/twirp
Dart github.com/apptreesoftware/protoc-gen-twirp_dart
Elixir github.com/keathley/twirp-elixir

This list isn't an endorsement, it's just a convenience to help you find stuff for your language.

Support and Community

We have a channel on the Gophers slack, #twirp, which is the best place to get quick answers to your questions. You can join the Gopher slack here.

Releases

Twirp follows semantic versioning through git tags, and uses Github Releases for release notes and upgrade guides: Twirp Releases

Contributing

Check out CONTRIBUTING.md for notes on making contributions.

License

This library is licensed under the Apache 2.0 License.

About

A simple RPC framework with protobuf service definitions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.4%
  • Python 2.8%
  • Other 0.8%