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
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
cmp.Or に感動した
otakakot
3
200
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
CSC509 Lecture 13
javiergs
PRO
0
110
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
subpath importsで始めるモック生活
10tera
0
310
Jakarta EE meets AI
ivargrimstad
0
220
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Featured
See All Featured
Happy Clients
brianwarren
98
6.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
The Pragmatic Product Professional
lauravandoore
31
6.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
GraphQLとの向き合い方2022年版
quramy
43
13k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Typedesign – Prime Four
hannesfritz
40
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Designing for humans not robots
tammielis
250
25k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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
ͱ͍͏ߟ͑ํ —ͦͷઃܭࢥͱֶ