Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[OLD] Evans: more expressive universal gRPC client
Search
ktr
November 11, 2017
Technology
1
4.3k
[OLD] Evans: more expressive universal gRPC client
latest:
https://speakerdeck.com/ktr_0731/evans-more-expressive-grpc-client-1
ktr
November 11, 2017
Tweet
Share
More Decks by ktr
See All by ktr
Designing libraries in Go way
ktr_0731
6
1.4k
Go Modules and Proxy Walkthrough
ktr_0731
8
26k
ソフトウェアの複雑さに立ち向かう技術 / Tackling software complexity
ktr_0731
0
160
Fuzzy finder as a Go library
ktr_0731
3
5.3k
つよくてニューゲーム / NewGame++
ktr_0731
0
890
やはり俺の Go アプリケーション設計はまちがっている。 / My Go Application Design Is Wrong, As I Expected
ktr_0731
13
3.4k
GopherCon2018
ktr_0731
2
1.7k
Evans: more expressive gRPC client
ktr_0731
2
400
自作 CLI ツールのワークフローとそれを支える技術 / the workflow of my CLI tool and technologies which supports it
ktr_0731
0
1.6k
Other Decks in Technology
See All in Technology
GitHub最新情報キャッチアップ 2024年3月
dzeyelid
16
3.1k
CI/CDがあたりまえの今の時代にAPIテスティングツールに求められていること / CI/CD Test Night #7
k1low
12
2.7k
MongoDB Atlas Vectorsearchではじめる生成AIアプリ開発
chie8842
3
500
LLMプロダクト事業の立ち上げにおける挑戦
layerx
PRO
7
1.4k
やっていきテスト
k6s4i53rx
0
160
任意コード実行の原理
ffri
0
170
Cloud Friendly(?) Jenkins. How we failed to make Jenkins cloud native and what we learned?
onenashev
PRO
0
110
社内共通ルールを値オブジェクトにして社内ライブラリとして運用してみた話
leveragestech
2
730
Introduction to Jetpack Compose
pohjus
1
110
Ask-LLM論文紹介: How to Train Data-Efficient LLMs
s_ota
0
110
『QAという人』が必要ではなく、『QAという技術』が必要
sadonosake
2
460
SREsのためのSRE定着ガイド
netmarkjp
10
1.5k
Featured
See All Featured
How GitHub Uses GitHub to Build GitHub
holman
467
290k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
A Tale of Four Properties
chriscoyier
150
22k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
The Cult of Friendly URLs
andyhume
72
5.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
57
14k
Building Adaptive Systems
keathley
29
1.8k
Mobile First: as difficult as doing things right
swwweet
215
8.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
67
38k
Transcript
#alt_0x09 ktr0731 / ktr_0731 Evans more expressive universal gRPC client
$ whoami @ktr_0731 / ktr0731 s123 プリンセス・プリンシパル
Evans more expressive universal gRPC client #alt_0x09 ktr0731 / ktr_0731
Evans more expressive universal gRPC client #alt_0x09 ktr0731 / ktr_0731
gRPC?
client/server が透過的に通信できるシステムを 簡単に構築するための RPC フレームワーク
gRPC Remote Procedure Calls, of course! https://grpc.io/faq/
define API schema generate client/server code Implement server logic
define API schema generate client/server code Implement server logic api.proto
(Protocol Buffers)
define API schema generate client/server code Implement server logic api.pb.go
(generated Go source)
define API schema generate client/server code Implement server logic main.go
(server)
define API schema generate client/server code Implement server logic main.go
(client)
define API schema generate client/server code Implement server logic client
output
client/server 間のインターフェースを自動生成
client/server 間のインターフェースを自動生成 = API の仕様を (ある程度) 反映できる
Go だと色々なミドルウェア (interceptor) が使える
Unary Client/Server Streaming Bidirectional Streaming
Unary Client/Server Streaming Bidirectional Streaming = Goodbye WebSocket
インターフェースの自動生成 Interceptor が使える 複数の RPC 方式
インターフェースの自動生成 Interceptor が使える 複数の RPC 方式 べんり
Demerits
HTTP/2 がまだまだ新しい技術 = LB やツール群が充実していない
gRPC のテストの問題 Curl 等で気軽にテストできなくてつらい
None
None
None
None
interactive mode command-line mode
command-line mode stdin や --file option で入力を選択できる JSON 形式の出力 スクリプトに組み込みやすい
わざわざスクリプトに書きたくない時 補完ないとしんどい時 複数の RPC を試したい時にべんり interactive mode
demo
1. REPL を起動する (c-bata/go-prompt) 2. proto ファイルの Unmarshal (golang/protobuf) 3.
message のフィールドを入力させる 4. 動的に message を組み立てる (jhump/protoreflect) 5. RPC
Streaming RPC TLS での通信 Map 型 ✏ reflection-server への対応 ✏
バイナリファイルの扱い
Issue / PR are welcome! https://github.com/ktr0731/evans
引用 • Evans (DJ YOSHITAKA) - https://itunes.apple.com/jp/album/jubeat- original-soundtrack/id325295989 • helloworld.proto
- https://github.com/grpc/grpc-go より、Apache License 2.0 の元に使用しています