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
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
380
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
280
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
460
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
280
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.2k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
Being A Developer After 40
akosma
87
590k
For a Future-Friendly Web
brad_frost
175
9.4k
Producing Creativity
orderedlist
PRO
341
39k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Faster Mobile Websites
deanohume
305
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Unsuck your backbone
ammeep
669
57k
Automating Front-end Workflow
addyosmani
1366
200k
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
ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥͱֶ