How To Build And Structure A Microservice In Golang?!
HTML-код
- Опубликовано: 15 сен 2024
- ► Join my Discord community for free education 👉 / discord
► Become a Patreon for exclusive tutorials 👉 / anthonygg_
► Follow me on Twitter 👉 / anthdm
► Follow me on GitHub 👉 github.com/anthdm
In this Golang tutorial, I'm going to show you my approach to building and structuring a microservice in Golang. So you can also start building microservices in Golang.
#golang #microservices
► Join my Discord community for free education 👉 discord.com/invite/bDy8t4b3Rz
► Become a Patreon for exclusive tutorials 👉 www.patreon.com/anthonygg_
Thanks for watching
what does instrumentation mean ?
I saw some other vids and at first I cringed at the "high value software engineer" stuff but the more vids I watch the more I realise he has a point; also, as far as I can tell, he is a seasoned gopher to say the least; this stuff is pure gold, so glad I stumbled upon this
Thanks my man!
Wow, that decorator design pattern on making the logger a wraper and the service the wrapee, was a brilliant move, loved it!
And on this example, you could repeat this pattern on the API, right? Implement the Start method and wrap it with the logger, so you can add a nice Listening on port :yourport
its not just about the bigger lesson in the video, your tips and hints - such as the defer trick with named returns - are valuable beyond reason!
I'll say it again, I came for copper and I found gold!
❤️
IMO he really gives useful tips even for progophers
I love how straight to the point this video was. I just landed a go job, and I am looking for content that gets me up to speed with real-life examples like this. Thank you for making great content!
Ur channel differs from others in terms of " How you bring up real prod scenario's to explain the concepts" This s too good man !!
Extremely helpful !!
You got a subscriber man! I love how simple and straightforward this is. No drama whatsoever.
But I have a request, please make a video on making microservices whilst working with frontend.
Ty
@@anthonygg_ what does Ty mean?
Thank you
@@ezrahel
I think that most value of your tutorial is that you show how to think on another way (you simply made chain of services). Changing way of thinking is most difficult for us who are coming from another programming languages.
Great work, Anthony.
9:40 till 9:43 "Only 10% of the Go devolopers know this stuff. Now you do also" Great video!
I am awe struck at the level of your delivery. This has been so helpful. Thanks.
The more I keep repeatedly watching the more new things I learn.... superb 👍
been watching your videos for months, and they are always informative, i'd really love to see you made a full where you write a full micro service, with microservices, caching and everything neccessary
I’ve been using node since 2011 and have defaulted to it literally for every backend. Prior to that I was objective C and C. I’ve just started with Go again - hate TS and node has got so bloated as an ecosystem. Go feels immediately comfortable and I see some similarities with my old iOS days. Your videos are very helpful 👍🏼
Love the pace! As a Go dev. I look exactly for this kind of videos! Thanks dude
Doing some research for Golang with microservices and stumbled upon this video and I have 2 things to say about it:
1. Great video, fast and on the subject
2. Didn't know Zizou does programming in his spare time:)
Haha. The first time someone called my Zizou. Most of the time its GSP, Arjan Robben or Johnny Sins. Anyhow, I take Zizou each time of the day. Viva La France
Great content as usual! Keep this quality coming🚀
Really professional and clean video!
💪u r a Champ !! u r the best Gopher from Golang RUclips Community !! Amazing Content.Kudos to uu brooo
Thanks man!
Love the content. Love the attitude around building up yourself and career. Thank you for the inspiration.
THISSS is the programming content I've been looking for. real-world application, project structure, higher level ans more abstract. other channels only blag on about algorithms and syntax which is only step 1
You are legit man! Great channel and content.
Anthony delivers again!
you are a LEGEND
It was awesome. I am new to go and learned a lot of stuffs.
Very useful trick with defer :D
The only issue I can see here is that interface Service (abstraction) uses struct CatFact at 2:15, which has annotation used by serialization tool.
IMO when it is a part of Service API, it should not be coupled to specific network representation :p
It breaks separation of concerns you mentioned at the beginning
Hey! Very good point. I think the Service should just return a (string, error) so it is not coupled with the CatFact struct, which is actually part of the JSON transport layer. Thanks for reminding me! Very good catch.
Greate content I've missed. Thank you
Man your content is Gold🌟🌟
Thank you 🙏
Man u are the best. I like your voice)
Thank You very much, Sir 🤍
I've just came from r/golang.
Subscribed.
Thank you!
I didn't get how the new files are created on the fly using ":e" ...
CFBR, Great video , keep it up Anthony
I’m generally down on micro, but I bet golang is perfect for this architecture
this is awesome, can you recommend a framework/lib that does this approach as boilerplate?
Everything looks beautiful and good, of course, BUT!
What if I have 3-5 entities and each one needs a microservice?
For example
1 Authorization
2User
3 Supplier
4Admin
and everyone has a different entrance????
Thank's Broo!
Cool, very nice.
Hi Anthony, I am new to go and sometimes wonder why you are using the design patterns (the use of structs, interfaces, and code pattern in general). Do you have a recommended resource that covers these patterns?
Not directly, I will make video about this. But a lot of the decisions I make comes with experience.
Is the code for this project on your GitHub? I like that it's a to-the-point example of a complete microservice that doesn't use gRPC. :-)
Is it recommended to use the hexagonal arquitecture for a microservice?
i am new to golang, so i can't understand this concept on 9:14 with deferred lambda function in func(s *LoggingService) GetCatFact. I don't understand, how we get variables "fact", "err" in the lambda. I understand, that firstly we have execution of s.next.GetCatFact, but where do this lambda take this variables from.. Could you help me? 👉👈
He has declared named return types. Those act like variable declarations within your functions body. You're able to access variables of the outer scope of the lambda within the lambda itself (like you can in Java; in C++ you'd do that through capturing). The defer puts the function call on the stack that is "consumed" when the GetCatFact functions scope ends. So after the return statement. The statement of the return itself though yields the values for fact and err which are then consumed by the function on the defer stack.
Which go framework do you advise a beginner to use
Fiber
@@anthonygg_ thank you
Спасибо!
Why do you always say w wee ? is that Golang jargon ? Wee means little or an act of urinating in English just curious ..top content otherwise Anthony 👍
Link me the timestamp of we wee
@@anthonygg_ from min 16:20
Would you mind to share github code ?
hilarious how half of inputs are incorrect and all the time is spent to rewrite written
If this video wos as "How I Structure New Projects In Golang" , it will soo mutch interesting & useful. This is boring
Yada yada yada
Holy shit is it annyoing to watch. You type everything at least 2-3 times, your cursor jumps around 5x for each action... Doesn't mean your content is not good, it really is, but that lowers the quality so much for me as it's just stressful to watch.
I agree. Thats already way better in my lasts videos. I can image its annoying. 😘
why you make mistakes every single keystroke you type. it is annoying...
Love your videos but your typing is driving me nuts.
Its driving me nuts also. 😓
@@anthonygg_ We need to buy you a mechanical keyboard. :-) Thanks for all the GO videos, I came from C, C#, and Java but GO is my new favorite.
This isn't a microsservice lol
Thanks for the detailed explaination -- I am able to write many examples github.com/mayur2011/gokit-microservices