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
790
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
68
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
940
やはり俺の 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
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Arm移行タイムアタック
qnighy
0
320
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
910
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Quine, Polyglot, 良いコード
qnighy
4
640
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Ruby is Unlike a Banana
tanoku
97
11k
A better future with KSS
kneath
238
17k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
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
ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥͱֶ