- Notifications
You must be signed in to change notification settings - Fork1
A simple RPC framework with protobuf service definitions
License
hyandell/twirp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Twirp is a framework for service-to-service communication emphasizing simplicityand minimalism. It generates routing and serialization from API definition filesand lets you focus on your application's logic instead of thinking aboutfolderol like HTTP methods and paths and JSON.
Define your service in aProtobuf file andthen Twirp autogenerates Go code with a server interface and fully functionalclients. It's similar togRPC, but without the customHTTP server and transport implementations: it runs on the standard library'sextremely-well-tested-and-high-performancenet/http
Server. It can run on HTTP1.1, not just http/2, and supports JSON clients for easy integrations acrosslanguages
Twirp handles routing and serialization for you in a well-tested, standardized,thoughtful way so you don't have to. Serialization and deserialization code iserror-prone and tricky, and you shouldn't be wasting your time deciding whetherit should be "POST /friends/:id/new" or "POST /:id/friend" or whatever. Justget to the real work of building services!
Along the way, you get an autogenerated client and a simple, smart framework forpassing error messages. Nice!
For more on the motivation behind Twirp (and a comparison to REST APIs and gRPC), theannouncement blog postis a good read.
Usego get
to install the Go client-and-server generator:
go get github.com/twitchtv/twirp/protoc-gen-twirp
You will also need:
- protoc, the protobuf compiler. You needversion 3+.
- github.com/golang/protobuf/protoc-gen-go,the Go protobuf generator plugin. Get this with
go get
.
Thorough documentation ison the wiki.
We have a channel on the Gophers slack,#twirp,which is the best place to get quick answers to your questions. You can join theGopher slackhere.
Twirp follows semantic versioning through git tags, and uses Github Releases forrelease notes and upgrade guides:Twirp Releases
Check outCONTRIBUTING.md for notes on making contributions.
This library is licensed under the Apache 2.0 License.
About
A simple RPC framework with protobuf service definitions
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Go98.2%
- Python1.5%
- Other0.3%