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
gRPC with Go
Search
ktr
July 22, 2017
Programming
0
800
gRPC with Go
ktr
July 22, 2017
Tweet
Share
More Decks by ktr
See All by ktr
Monorepo における Go テストの差分実行 / Running Differential Go Tests in a Monorepo
ktr_0731
0
90
Designing libraries in Go way
ktr_0731
6
1.5k
Go Modules and Proxy Walkthrough
ktr_0731
8
27k
ソフトウェアの複雑さに立ち向かう技術 / Tackling software complexity
ktr_0731
0
180
Fuzzy finder as a Go library
ktr_0731
3
5.7k
つよくてニューゲーム / NewGame++
ktr_0731
0
950
やはり俺の Go アプリケーション設計はまちがっている。 / My Go Application Design Is Wrong, As I Expected
ktr_0731
13
3.5k
GopherCon2018
ktr_0731
2
1.8k
Evans: more expressive gRPC client
ktr_0731
2
450
Other Decks in Programming
See All in Programming
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
103 Early Hints
sugi_0000
1
230
MCP with Cloudflare Workers
yusukebe
2
220
Symfony Mapper Component
soyuka
2
730
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
780
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
BBQ
matthewcrist
85
9.4k
Automating Front-end Workflow
addyosmani
1366
200k
KATA
mclloyd
29
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Documentation Writing (for coders)
carmenintech
66
4.5k
GraphQLとの向き合い方2022年版
quramy
44
13k
Transcript
GRPC with Go @ktr_0731
Profile $ whoami ‣ Taro Aoki / @ktr_0731 ‣ s123@u-aizu
‣ αʔόαΠυΤϯδχΞ ‣ Go ͕͖ (9 ϲ݄͘Β͍) ‣ Web ͕͖
None
None
None
What is gRPC?
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳͷ
gRPC A RPC library and framework ‣ package ‣ messages
‣ services ‣ RPCs
None
None
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ‣ middleware ͷΑ͏ͳͷ
gRPC A RPC library and framework ‣ IDL(Interface Definition Language)
Ͱ Service Λఆٛ ‣ σϑΥϧτ Protocol Buffers ‣ αʔό / ΫϥΠΞϯτͷελϒΛࣗಈͰ࡞ͬͯ͘ΕΔ ‣ Interceptors ͕ศར ͷָ͘͢͝!!
gRPC What does "g"RPC stands for? ‣ 1.0: gRPC ‣
1.1: good ‣ 1.2: green ‣ 1.3: gentle ‣ 1.4: gregarious
gRPC gRPC with Go ‣ gRPC ͱ Go ૬ੑ͕ྑ͍ ‣
Interceptor ͕͑Δ ‣ Go ͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ੩తܕ͚
gRPC gRPC with Go ‣ gRPC ͱ Go ૬ੑ͕ྑ͍ ‣
Interceptor ͕͑Δ ‣ Go ͚ͷ gRPC Ecosystem middleware ͕ଟ͍ ‣ ͲͪΒ੩తܕ͚ ‣ Go Ͱαʔό͕ॻ͚Δتͼ
gRPC
gRPC Demerits of gRPC ‣ REST ʹൺͯखಈͷςετ͕໘ ‣ ͪΐͬͱͨ࣌͠ʹ curl
ͰςετͰ͖ͳ͍
gRPC Demerits of gRPC ‣ REST ʹൺͯखಈͷςετ͕໘ ‣ ͪΐͬͱͨ࣌͠ʹ curl
ͰςετͰ͖ͳ͍ ‣ grpc-ecosystem/polyglot ‣ ൚༻త͍͗ͯͮ͢Β͍ ‣ Java ͳͷͰ JVM ͷىಈʹ͕͔͔࣌ؒΔ
Let’s make it myself
lycoris0731/evans
lycoris0731/evans ʊਓਓਓਓਓਓʊ ʼɹ։ൃ్தɹʻ ʉ:?:?:?:?:ʉ
Evans Overview of Evans ‣ Go ͷ Universal gRPC Client
‣ Interactive (REPL) Ϟʔυ ‣ ରతʹ message Λೖྗ ‣ ಈతͳิػೳ ‣ Non-interactive (CLI) Ϟʔυ ‣ UNIX ֶʹଇΔ
Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods /
Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message ΛΈཱͯΔ ‣ Remote procedure call
Evans Mechanism ‣ proto ϑΝΠϧΛಡΈࠐΈ ‣ Services / Methods /
Messages Λऔಘ ‣ Message ͷϑΟʔϧυΛऔಘ ‣ ֤ϑΟʔϧυΛೖྗͤ͞Δ ‣ DynamicMessage Λར༻ͯ͠ Message ΛΈཱͯΔ ‣ Remote procedure call
Evans Mechanism ‣ go-protobuf ʹ DynamicMessage ͕ͳ͍ ‣ Go Ͱ͍͏
reflect ‣ jhump/protoreflect Λར༻
demo
CLI References ‣ GoݴޠͰςετ͍͢͠ίϚϯυϥΠϯπʔϧΛͭ͘Δ (http://deeeet.com/writing/2014/12/18/golang-cli-test/) ‣ GoݴޠʹΑΔCLIπʔϧ։ൃͱUNIXֶʹ͍ͭͯ (http://blog.yuuk.io/entry/go-cli-unix) ‣ UNIX
ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥͱֶ