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
今更GoのWebフレームワークを作ろうとしているワケ / Why am I trying to...
Search
mackee
September 13, 2024
Programming
1
48
今更GoのWebフレームワークを作ろうとしているワケ / Why am I trying to create a Go web framework now?
Asakusa.go #3
https://asakusago.connpass.com/event/327677/
mackee
September 13, 2024
Tweet
Share
More Decks by mackee
See All by mackee
マイクロサービス化を利用した Goへの移行事例
mackee
0
92
PerlでつくるフルスクラッチWebAuthn/パスキー認証 / Demonstration of full-scratch WebAuthn/Passkey Authentication written in Perl
mackee
3
2.8k
SRE定例やその辺の取り組みをアプリケーションエンジニア目線で語る / "Observe" about SRE Meeting by Application Engineer
mackee
0
1.7k
TinyGoで使えるORM sqllaの 紹介とTinyGoで使えるようにするための工夫
mackee
0
920
Go向けORM sqllaの紹介と JOINやUNIONを含んだクエリの扱い方
mackee
0
3.8k
デプロイ今昔物語 〜CGIからサーバーレスまで〜 / The deployment technics
mackee
10
11k
E2Eテストから負荷試験シナリオを作ってみた / Why do we make a scenario of load testing from E2E testing scenarios
mackee
3
5.2k
じわじわとPerlからGoに移行しようとしている俺達のマイクロサービシーズの紹介 / The migrating to microservices in Go from Monolith in Perl
mackee
2
2.9k
Mojoliciousで書いて理解するhotwireの仕組み
mackee
0
4.8k
Other Decks in Programming
See All in Programming
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
120
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
420
オートマトン学習しろ / Do automata learning
makenowjust
3
130
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
Ruby Parser progress report 2024
yui_knk
2
230
XStateでReactに秩序を与えたい
gizm000
0
730
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
470
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
4
90k
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
Some more adventure of Happy Eyeballs
coe401_
2
190
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
140
Swiftコードバトル必勝法
toshi0383
0
170
Featured
See All Featured
Statistics for Hackers
jakevdp
794
220k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
Unsuck your backbone
ammeep
667
57k
Design by the Numbers
sachag
277
19k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Clear Off the Table
cherdarchuk
91
320k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
41
6.5k
Docker and Python
trallard
39
3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
Side Projects
sachag
451
42k
Transcript
ࠓߋGoͷWebϑϨʔϜϫʔ ΫΛ࡞Ζ͏ͱ͍ͯ͠Δϫέ @macopy Asakusa.go 2024-09-13
https://github.com/mackee/tanukirpc
ಛ1: ܕ҆શϋϯυϥʔ
ಛ2: ϦΫΤετείʔϓDI
ಛ3: ΫϥΠΞϯτίʔυੜ
ಛ3: ΫϥΠΞϯτίʔυੜ
GoͷWebΞϓϦέʔγϣϯ ϑϨʔϜϫʔΫ ଞʹͨ͘͞Μ͋Δ ͳͥ࡞ͬͨͷ͔ʁ
1. Easy͔ͭఆ൪͕ͳ͍ • GoͷϑϨʔϜϫʔΫ͍͍ͨͯsimpleدΓ • ϑϨʔϜϫʔΫͱ͍͏ΑΓϥΠϒϥϦ(ϧʔλʔͳͲ) • Ұͭͷ͜ͱΛ͏·͘ΔύʔπΛબΜͰ͏ܗʹͳΔ • બͿࣗ༝͕͋ͬͯྑ͍…͕ԿճΔͱϥΠϒϥϦಉ࢜Λͭͳ͙άϧʔ
ίʔυΛຖճॻ͍͍ͯΔ͜ͱʹؾ͕͍ͭͨ • ͍͜͜ΒͰԶͷߟ͑ͨ࠷ڧͷϥΠϒϥϦͷΈ߹ΘͤΛ࡞ͬͨΒͲ͏͔ʁ
2. ৽ͨʹϥΠϒϥϦΛಋೖ͢ΔΘ͠͞Λݮ ͢Δ • tanukirpcgo-playground/validator͕࠷ॳ͔Βೖ͍ͬͯΔ • structλάʹॻ͚ͩ͘Ͱػೳ͢Δ • ͜͏͍͏ͷͬͯόϥόϥʹೖΕΔͱޙճ͠ʹͳΓ͕ͪ •
ʮೖΕΔͷʹࠊ͕ॏ͍ͳΒ࠷ॳ͔ΒϑϨʔϜϫʔΫʹΈࠐΉʯͱ͍ ͏ࢥ
3. ΧελϚΠζੑ • ࠷ॳσϑΥϧτڍಈͰྑ͍͕ɺ࡞͍ͬͯ͘ͱཁ݅ʹΑͬͯΧελϜ ͍ͨ͜͠ͱ͕͋Δ • ࠷ۙͩͱΤϥʔ࣌ͷϨεϙϯε • ͦ͏͍͏ͷશ෦ΧελϜͰ͖ΔΑ͏ʹ࡞ͬͯ͋Δ •
ϩΨʔ࠷ॳ͔Β͍ʹͳΔʢΞΫηεϩάʂʣ͕ɺΧελϜͰ ͖ΔΑ͏ʹͳ͍ͬͯΔ
࠷ۙ࡞ͬͨػೳ • tanukiupίϚϯυ͕HTTPϦΫΤετΛ·ͣड͚Δػೳ • tanukiup: ϑΝΠϧΛࢹͯ͠Ϗϧυͱαʔόʔϓϩηε࠶ىಈΛ͢ Δ։ൃ༻ίϚϯυ • tanukiup͕αʔόʔͱͳΓɺUnixυϝΠϯιέοτͰ։ൃதͷαʔ όʔʹϓϩΩγ͢ΔػೳΛ࡞ͬͨ
࠷ۙ࡞ͬͨػೳ UBOVLJVQ TCP 8080 BQQ UDS ϑΝΠϧ͕ߋ ৽͞ΕΔͨͼʹϏ ϧυɾ࠶ىಈ
ͳ͍ͥͬͨΜtanukiup͕ड͚Δʁ • ΞϓϦαʔόʔʹੜ͍͑ͯΔAPIύεҎ֎ΛϑϩϯτΤϯυ։ൃαʔ όʔʹ͚ΔͨΊ • tanukiup੩తղੳΛͯ͠ͲͷύεΛrouterʹొ͍ͯ͠Δ͔Λ ͍ͬͯΔ • routerʹొ͞Ε͍ͯΔύεҎ֎Λvite dev
serverͳͲʹྲྀ͢͜ͱ ͰɺϑϩϯτΤϯυΛؚΊͨ։ൃαʔόʔΛ·Δͬͱಉ͡ϙʔτͰ ड͚ΒΕΔ
tanukiupͰviteproxy UBOVLJVQ TCP 8080 BQQ UDS tanukirpcͰੜͨ͠ύεͷΈ WJUFEFW TFSWFS TCP
5173
Web։ൃ͓ࠔΓ͝ͱΛશ෦͍ͬͯͬͯΈΔ • ͍ͬͨΜΓ͗͢ͱ͍͏ͱ͜Ζ·Ͱͬͯྑ͍ͷͰͳ͍͔ • Ώ͘Ώ͘ORMDBϚΠάϨʔγϣϯɺϑϩϯτΤϯυελοΫؚ Ίͨscaffolding͘Μ࡞Δ༧ఆͰ͢ • ͪΖΜORMࣗ࡞ͷsqlla • ͋ͱೝূηογϣϯपΓΈࠐΉ༧ఆͰ͢
for { select { case <-question: answer() case <-feedback: listen()
case <-ctx.Done(): break } }