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
What is Parser
yui_knk
9
4.1k
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
Hono・Prisma・AWSでGeoなAPI開発
nokonoko1203
5
680
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
1
470
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
660
How to Break into Reading Open Source
kaspth
2
210
The Shape of a Service Object
inem
0
520
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
550
今インフラ技術をイチから学び直すなら
yuhta28
1
140
実践!難読化ガイド
mitchan
0
200
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Embracing the Ebb and Flow
colly
83
4.4k
Designing with Data
zakiwarfel
98
5k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
4 Signs Your Business is Dying
shpigford
179
21k
Scaling GitHub
holman
458
140k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
Facilitating Awesome Meetings
lara
49
5.9k
A designer walks into a library…
pauljervisheath
201
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Building Flexible Design Systems
yeseniaperezcruz
325
38k
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 } }