Тёмный

GopherCon 2019: Mat Ryer - How I Write HTTP Web Services after Eight Years 

Gopher Academy
Подписаться 36 тыс.
Просмотров 75 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@VitalyZdanevich
@VitalyZdanevich 3 года назад
Thank you for dark slides.
@nodidog
@nodidog 6 месяцев назад
Love the defer goodbye() straight after hello() 😂
@noli-timere-crede-tantum
@noli-timere-crede-tantum 3 года назад
"Although, Packt" hahaha - I hear ya, bruh. One blog post and one demo video on RU-vid, and next thing you know, I have two book on Packt :)
@MohammedKamil
@MohammedKamil Год назад
This is the most approachable talk/talker I've seen, kodus
@codeconcept
@codeconcept 8 месяцев назад
Still very valuable in 2024. Thanks Mat 😀
@karlpokus
@karlpokus 5 лет назад
Great talk! Thanks for sharing Mat!
@harogaston
@harogaston 2 месяца назад
Was expecting more for 8 years of learnings tbh, this is more like 2-3 years maybe...if you are not full time
@david.budnick
@david.budnick 2 года назад
Great talk, thanks for sharing!
@arhyth
@arhyth 5 лет назад
if not in constructor, where does one setup the server dependencies then? especially dependencies that need to be mocked up in tests. true, having to explicitly provide dependencies is bothersome but it’s the only way i can think of without magic dependencies and untestable behavior.
@epiicSpooky
@epiicSpooky 5 лет назад
You pass them in to the constructor (as mentioned in the talk, only practical if there are just a few), or initialize the server struct directly and assign them later, or create a dependencies public struct that you pass in (e.g. MyServer.New(MyServer.Deps{DB: dbconn, SomeClient: client})). In New(), there is code to do things like setup routes - very specific initialization to your service. You want to run that in your unit tests, and so you don't want to mix in initializing services in there because if you do it's harder/impossible to test. There are some "Clean Code Talks" from about a decade ago here on YT that explain the value of that approach - you don't build a car and expect it to build an engine for itself - you build an engine and a car and give it to the car in your setup. It helps for testability to move initialization as far up the call chain as you can. So your main module usually does a lot of the boring initialization of things, all in one place where all the dependencies are clear. It also simplifies refactoring like he mentioned breaking a big service into separate services. Give the db connection to the small services and give the small services to the main server.
@liangli6276
@liangli6276 2 года назад
is there any github code example ?
@Violaphobia
@Violaphobia 5 лет назад
This video is great, but as a real newby to Golang I'm confused on a few points. At 27:55, what does this accomplish? Are these structs used inside the handler function somewhere?
@CR7Ashironaldo
@CR7Ashironaldo 5 лет назад
the request struct is used to unmarshall the request body of the request, the response struct to fill the response and then encode it in json and write to response writer, they will be used by that returned HandlerFunc.
@asfaltboy
@asfaltboy 4 года назад
This is a common practice when writing an API endpoint, to take a serialized request and return a serialized response (e.g a JSON string in the body), and mapping these to structs and doing validation and deserialization once before handling business logic. Here's an example some might find useful: www.alexedwards.net/blog/how-to-properly-parse-a-json-request-body
@spencerlong2745
@spencerlong2745 2 года назад
Wow, what an awesome talk, cheers Mat.
@VitalyZdanevich
@VitalyZdanevich 3 года назад
Put URL of the blog post to the description.
@vaskir3695
@vaskir3695 3 года назад
Great talk, thanks.
@sergsergesrgergseg
@sergsergesrgergseg 3 года назад
is there a written version
@SouvikHaldarmustang
@SouvikHaldarmustang Год назад
This is my de-facto standard for building APIs.
@nroose
@nroose 8 месяцев назад
Those one letter variable names really bother me for some reason.
@MrChickenpoulet
@MrChickenpoulet 3 года назад
what a nice talk!
@inaccessiblecardinal9352
@inaccessiblecardinal9352 7 месяцев назад
Excellent talk. Keeping it clean and simple.
@nmezhenskyi
@nmezhenskyi 2 года назад
Great presentation! I keep coming to this video quite often.
@cs80211
@cs80211 Год назад
Is there an example code 😢
@edwingarcia5043
@edwingarcia5043 2 года назад
From this I learned many things, thanks 👍🏽
@maheshkottapalli6945
@maheshkottapalli6945 3 года назад
Thank you very much.....
@cgossain
@cgossain 2 года назад
Really great talk!
@ismaelgrahms
@ismaelgrahms Год назад
Great advices
@GAMarine137
@GAMarine137 4 года назад
I highly recommend the Gin framework for REST services
@aleyrizvi
@aleyrizvi 5 месяцев назад
Not until you reach the point where you have to fight the framework.
Далее
🦊🎀
00:16
Просмотров 415 тыс.
Трудности СГОРЕВШЕЙ BMW M4!
49:41
Просмотров 1,7 млн
Airpod Through Glass Trick! 😱 #shorts
00:19
Просмотров 356 тыс.
GothamGo 2018 - Things in Go I Never Use by Mat Ryer
24:53
HTMX & Go with ThePrimeagen | Preview
15:58
Просмотров 154 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 83 тыс.
Top 6 Most Popular API Architecture Styles
4:21
Просмотров 913 тыс.
THIS is the BEST Way to Write HTTP Services in Golang
13:53
GopherCon 2019: Marwan Sulaiman - Handling Go Errors
31:55
GopherCon 2017: Kavya Joshi - Understanding Channels
21:45
GopherCon 2019: Elena Morozova - How Uber Goes
23:31
Просмотров 22 тыс.
🦊🎀
00:16
Просмотров 415 тыс.