A local meetup to show some of the features of the Twirp RPC framework

Related tags

Network twirpdemo
Overview

twirpdemo

This repo was created for a local meetup to show some of the features of the Twirp RPC framework.

Usage

Generate proto code:

protoc  --twirp_out=. --go_out=. proto/rpc.proto

Run the calculator service:

$ go run cmd/calculatorsvc/main.go
2021/11/19 13:13:43 server started at port 8080

Make a request using curl:

$ curl \
  --request "POST" \
  --header 'Content-Type:application/json' \
  --data '{"a": 10, "b": 5}' \
  http://localhost:8080/twirp/Calculator/Add

{"result":15}⏎

Make a request using generated Go client:

$ go run cmd/calculatorctl/main.go
Result = 15
You might also like...
A SimpleHTTPServer written in Go, enhanced with features and with a nice design
A SimpleHTTPServer written in Go, enhanced with features and with a nice design

goshs is a replacement for Python's SimpleHTTPServer. It allows uploading and downloading via HTTP/S with either self-signed certificate or user provi

A rule-based tunnel in Go with experimental features
A rule-based tunnel in Go with experimental features

Experimental-Clash A rule-based tunnel in Go with experimental features. Features Local HTTP/HTTPS/SOCKS server with authentication support VMess, Sha

GopherTalk: a multi-user chat powered by GO to explore its standard library and features like sockets, goroutines, channels and sync package Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies
Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies

Coral Preamble I love Cobra and I love Viper. They are great projects, incredibly useful and outstandingly important for the Go community. But sometim

Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.
Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.

Thank you for your interest in ZASentinel ZASentinel helps organizations improve information security by providing a better and simpler way to protect

A protoc-gen-go wrapper including an RPC stub generator

// Copyright 2013 Google. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE fi

Simple, fast and scalable golang rpc library for high load

gorpc Simple, fast and scalable golang RPC library for high load and microservices. Gorpc provides the following features useful for highly loaded pro

A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.
A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.

Realtime API Gateway Synchronize Your Clients Visit Resgate.io for guides, live demos, and resources. Resgate is a Go project implementing a realtime

network multiplexing and framing protocol for RPC

TChannel Network multiplexing and framing protocol for RPC Read the Docs Languages: Node.js, Python, Go, Java Questions: Open a Github issue Uber's OS

Comments
  • Question about Twirp and gRPC

    Question about Twirp and gRPC

    Thanks for the demo first 🏅 . I have a couple of questions about twirp and demo as follows;

    1. Let say that I am building a public API and generating clients for multiple languages. Is it possible to skip the client generation part for twirp, since I don't want to maintain the client part in the related service implementation folder?
    2. This is partially related to question#1. Client generation seems practical in terms of consuming it on other services, e.g. product service uses customer service client to consume customer endpoints. If you are in a monorepo, do you directly use customer service client in product service by accessing that package? Or you are using replace directive within your productservice/go.mod file?
    3. You can ignore this if you are not using dedicated repo for your microservices. Do you generate a client within the service repo and tag it as client/v1.9.1 and use something like github.com/fatih/customerservice client/v1.9.1 in your product service go mod file?
    4. Have you ever thought to maintain your proto files in a separate repo so that with a simple GitHub action, you can generate lang-specific grpc implementations and use them as a dependency in any client project? e.g. https://github.com/huseyinbabal/demory-proto
    5. Do you think, tracing and observability are easy within twirp? Any plug-and-play integration so that my correlation ids can be autogenerated and passed between services.

    Thanks in advance

    opened by huseyinbabal 2
Owner
Fatih Arslan
Software Engineer. Gopher and Coffee geek. Creator of vim-go. Tool maker.
Fatih Arslan
Antenna RPC is an RPC protocol for distributed computing, it's based on QUIC and Colfer. its currently an WIP.

aRPC - Antenna Remote Procedure Call Antenna remote procedure call (aRPC) is an RPC protocol focused on distributed processing and HPC. aRPC is implem

Raphael de Carvalho Almeida 3 Jun 16, 2021
rpc/v2 support for JSON-RPC 2.0 Specification.

rpc rpc/v2 support for JSON-RPC 2.0 Specification. gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of

High Performance, Kubernetes Native Object Storage 3 Jul 4, 2021
Go Substrate RPC Client (GSRPC)Go Substrate RPC Client (GSRPC)

Go Substrate RPC Client (GSRPC) Substrate RPC client in Go. It provides APIs and types around Polkadot and any Substrate-based chain RPC calls. This c

Chino Chang 1 Nov 11, 2021
null 39 Sep 10, 2022
A simple RPC framework with protobuf service definitions

Twirp is a framework for service-to-service communication emphasizing simplicity and minimalism. It generates routing and serialization from API defin

Twitch 6.1k Sep 27, 2022
A Light Golang RPC Framework

Glory Glory框架为一款Go语言的轻量级RPC框架,您可以使用它快速开发你的服务实例。如果您希望在微服务场景下使用gRPC进行网络通信,那么Glory会使您的开发、运维工作量减轻不少。 欢迎访问Glory主页: glory-go.github.io 示例仓库:github.com/glory

null 122 Aug 4, 2022
Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance.

Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance. RPC is usually heavy on processing logic and therefore cannot handle I/O serially. But Go's standard library net designed blocking I/O API, so that the RPC framework can only follow the One Conn One Goroutine design.

CloudWeGo 3.1k Sep 29, 2022
Fast and Scalable RPC Framework

Rony (Fast and Scalable RPC Framework) About Rony lets you create a clustered aware service easily. Checkout Wiki Performance Rony is very fast and wi

Ronak Software Group 39 Sep 23, 2022
Gbio - Extremely minimalist RPC framework - Go but interface only

gbio !!! ?? WIP ?? !!! Go but interface only. gbio is a(n): Extremely minimalist

ANQUR 3 Jan 3, 2022