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
net/httpでつくるHTTPルーター自作入門
Search
bmf_san
November 13, 2021
0
510
net/httpでつくるHTTPルーター自作入門
https://gocon.jp/2021autumn/sessions/handmade-http-router/
bmf_san
November 13, 2021
Tweet
Share
More Decks by bmf_san
See All by bmf_san
契約テストとPactについて
bmf_san
0
38
5分でわかるSLO
bmf_san
2
55
権限について考える
bmf_san
2
67
自作HTTPルーターから新しいServeMuxへ
bmf_san
3
1.6k
古くなってしまったPHPフレームワークとPHPのバージョンアップ戦略
bmf_san
1
260
アジャイルワークショップ
bmf_san
0
94
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
2.3k
天下一HTTPRouter武闘会.pdf
bmf_san
8
4.2k
ゆっくりHackerRank
bmf_san
0
110
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Designing for Performance
lara
604
68k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
How STYLIGHT went responsive
nonsquared
95
5.2k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
KATA
mclloyd
29
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Visualization
eitanlees
145
15k
Adopting Sorbet at Scale
ufuk
73
9.1k
Transcript
net/httpͰͭ͘Δ HTTPϧʔλʔࣗ࡞ೖ @bmf_san Go Conference 2021 Autumn
• Kenta Takeuchi • @bmf_san • גࣜձࣾϚΫΞέ/Re-ArchitectureνʔϜ • ֤छΤϯδχΞืूதͰ͢ʂ ࣗݾհ
ࠓ͢͜ͱ GoͰඪ४ύοέʔδ͚ͩΛͬͯɺ HTTPϧʔλʔΛࣗ࡞͢Δ
͜Μͳํʹ • Goͷॳֶऀ • GoͰԿ͔࡞ͬͯΈ͍ͨਓ • ݴޠΘͣHTTPϧʔλʔΛ࡞ͬͯΈ͍ͨਓ
ࣗ࡞ͯ͠ΈΔͱɾɾ • net/httpͷཧղΛਂΊΔ͖͔͚ͬʹ • ΞϧΰϦζϜͱσʔλߏΛֶͿ͖͔͚ͬʹ • ੈͷதͷHTTPϧʔλʔͷߏ͕େମ͔ΔΑ͏ʹ • ࣗ࡞ͷϧʔλʔͰΞϓϦΛ࡞ΕΔΑ͏ʹ
લఏ • Goͷجຊతͳจ๏ͷཧղ • Կ͔͠ΒͷHTTPϧʔλʔΛͬͨ͜ͱ͕͋Δ
Zenn Book
࣍ • HTTPϧʔλʔͱԿ͔ • HTTPϧʔλʔͷσʔλߏ • net/httpʹ͍͓͖͍ͭͯͬͯͨ͜ͱ • ࣮ͷհ
HTTPϧʔλʔͱ • ϦΫΤετ͞ΕΔURLͱϨεϙϯεͷॲཧΛ݁ͼ͚ͭΔ
HTTPϧʔλʔͷσʔλߏ • ϦΫΤετ͞ΕΔURLͱϨεϙϯεͷॲཧ Λ݁ͼ͚ͭΔ URLͱॲཧ͕Ϛοϐϯά͞Εͨ σʔλ͕ඞཁ
HTTPϧʔλʔͷσʔλߏ • URLͷ֊ → ߏͱͯ͠දݱ
• ʹϊʔυΛՃ͢Δ㲈ϧʔτͷఆٛ • ͔ΒϊʔυΛ୳ࡧ͢Δ㲈ϧʔςΟϯά HTTPϧʔλʔͷσʔλߏ
net/httpʹ͍͓͖͍ͭͯͬͯͨ͜ͱᶃ • ʮϚϧνϓϨΫαʯͱʮϋϯυϥʯ • ϚϧνϓϨΫα • ϦΫΤετͷURLΛొࡁΈͷύλʔϯͱরΒ͠߹Θͤ ͯɺ࠷Ϛον͢ΔϋϯυϥΛݺͼग़͢ • ϋϯυϥ
• ϦΫΤετʹԠͨ͡ॲཧΛฦ͢
net/httpʹ͍͓͖͍ͭͯͬͯͨ͜ͱᶄ • ϚϧνϓϨΫα • Ͳ͜ͰɺͲͷΑ͏ʹϋϯυϥΛొ͍ͯ͠Δͷ͔ • Ͳ͜ͰɺͲͷΑ͏ʹURLͱύλʔϯͷϚονϯάΛߦ͍ͬͯ Δ͔ • ϋϯυϥ
• ͲͷΑ͏ʹϋϯυϥΛ࣮͢Δͷ͔ • HandleɺHandlerɺHandleFuncɺHandlerFuncΛΔ • ຬ͍ͨͨ͠ΠϯλʔϑΣʔεԿ͔
• ͜ͷܗͷHTTPαʔόʔͷίʔυΛಡΈղ͘ͷ͕͓͢͢Ί ίʔυϦʔσΟϯά
• ϝιουϕʔεͷϧʔτఆٛΛαϙʔτ͚ͨͩ͠ͷ؆қతͳϧʔλʔͷ࣮ • ґଘඪ४ύοέʔδͷΈ ࣮ https://github.com/bmf-san/introduction-to-golang-http-router-made-with-net-http/
Github https://github.com/bmf-san/goblin
ؔ࿈ϦϯΫ ݻఆπΠʔτʹͿΒԼ͛ͯ͋Γ·͢
͋Γ͕ͱ͏Go͍͟·ͨ͠ʂ