Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Unlocking net/http APIs (Kaylyn Gibilterra 2019)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
GopherConAU
October 31, 2019
Programming
28
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Unlocking net/http APIs (Kaylyn Gibilterra 2019)
GopherConAU
October 31, 2019
More Decks by GopherConAU
See All by GopherConAU
Go for Decimals (Josh Carpeggiani 2019)
gopherconau
0
29
Inclusiveness - It's In Your Hands (Adel Smee 2019)
gopherconau
0
26
Migrate to a New Platform by Creating a Pipeline in Go (Julia Wong 2019)
gopherconau
0
53
The Fyne GUI Toolkit (Steve O'Connor 2019)
gopherconau
0
580
Designing Go Services For Continuous Deployment (Am Laher 2019)
gopherconau
0
33
PDF Full Text Search in Go (Peter Williams 2019)
gopherconau
0
19
Profiling in Production (Alexander Else 2019)
gopherconau
0
75
Getting Started with Deep Learning in Go (Darrell Chua 2019)
gopherconau
0
33
Recommendations That Don't Suck (Gareth Seneque 2019)
gopherconau
0
55
Other Decks in Programming
See All in Programming
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
140
golang-bob.pdf
iwatsukayura
0
130
R8 の設定見直しでアプリサイズ削減
andpad
0
220
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
ActionController meets Protocol Buffers
sorah
0
520
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
300
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Being A Developer After 40
akosma
92
590k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Why Our Code Smells
bkeepers
PRO
340
58k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
Transcript
Unlocking net/http APIs Kaylyn Gibilterra - @kgibilterra Capital One @egonelbre
None
None
None
Part 1 - Basic API Part 2 - Building a
Router Part 3 - Router Extensions
None
1. 2.
Line 1 http.HandleFunc("/hello", hello)
What is a handler?
What is a handler?
What is a handler?
What is a handler?
What is a handler?
What is HandlerFunc?
Line 2 http.ListenAndServe(":8080", nil)
What is a Server?
1. 2.
0.
What is a ServeMux?
Creating more complex routes
Part 2 - Building a Router
Get all salutations
Get all salutations
Get all salutations
Get one salutation
Get one salutation
HTTP Requests
HTTP Requests
salutationsRouter()
Get one salutation
Create new language
Create new language
Create new language
Phase 3 - Router Extensions
Parsing multiple parameters
Parsing a query parameter
Adding middleware
Passing a parameter through context
None
Thank You Kaylyn Gibilterra - @kgibilterra Capital One @egonelbre
What is a ServeMux?
What is a ServeMux?
What is a handler?
What is a handler?
What is a handler?
Longer patterns are matched first
“/” matches all non-registered patterns
ServeMux will redirect subtree root matches
Host-specific patterns take precedence over general
URL request path and Host header sanitizing
Things I could talk about: • Building an API ◦
Handlers ◦ ListenAndServe ◦ Mux & routing ◦ Request ◦ Restricting Methods ◦ Response ◦ Parsing a request: ▪ Json unmarshal ▪ Reading a body • Calling an API ◦ Client: https://medium.com/@nate 510/don-t-use-go-s-default- http-client-4804cb19f779 ◦ Server • Transport - TLS, setting proxies • CORS • Interfaces • Context • Middleware • Testing • http.Error maybe?