Getting Started with Protocol Buffers in Go - Tutorial

  Рет қаралды 63,393

TutorialEdge

TutorialEdge

Күн бұрын

👨‍💻 For the price of a ☕ every month, sign up and gain access to a growing list of premium courses on my site - tutorialedge.net/pricing/ 👩‍💻
● SUBSCRIBE to see more of my Videos & hit that LIKE button to support the channel!
Welcome fellow coders! In this tutorial, we are going to be looking at how you can utilize the Protocol Buffers data format within your Go-based applications. We’ll be covering what the data format is, and why it is an improvement over more traditional data formats such as XML or even JSON. And we’ll dive into a simple example to get us up and running before trying our hands at a more complex example.
By the end of this tutorial, you should be fairly comfortable with the basics and you’ll subsequently be able to go out and build your own more advanced systems.
Text Tutorial: tutorialedge.net/golang/go-pr...
Protocol Buffer basics: developers.google.com/protoco...
Go Generated Code: developers.google.com/protoco...
‎● My Twitter ► ⁦‪ / elliot_f
‎● My Website ► tutorialedge.net
‎--------------
🎥 Recording Setup
Microphone - amzn.to/3hvASys
Mic Boom - amzn.to/3o0cW8Q
Mouse - amzn.to/2WZMoZs
Monitor 1 - amzn.to/38IUlYy
Monitor 2 - amzn.to/3rBTZf7
Mount - amzn.to/3o3185V
USB-C Hub - amzn.to/3o2xRbw

Пікірлер: 44
@codelinx
@codelinx 4 ай бұрын
Great info. Always find the tutorials you make really cleanly structured.
@brus54per
@brus54per 2 жыл бұрын
Heavy snowstorm outside but you made the sun shine :) Thank you for videos on interesting topics on Go and not just the bare basics. Seems like I'll be spending some coffee on you...
@nihalsrivastava6844
@nihalsrivastava6844 2 жыл бұрын
Hey man, really nice video. Sweet and simple. Easy to understand.
@Celsian
@Celsian Жыл бұрын
Thank you, that was a lot easier than I thought it was going to be.
@sowellmemo
@sowellmemo 4 жыл бұрын
Cool. I've never heard of it. I was searching how to use the X protocol on mysql, and then it was mentioned there. Got curious and ended up here :D
@kepinghu3761
@kepinghu3761 5 жыл бұрын
A lot of help, thanks!
@drynnbavis
@drynnbavis 3 жыл бұрын
Would have been nice if you showed the size of the protobuff version of person for comparison to JSON and XML, otherwise nice vid : ) I guess we could find it for ourselves by counting the bytes in your marshalled output? I'm just lazy tbh
@Oswee
@Oswee 5 жыл бұрын
Great. Please continue on gRPC path!
@kudoamv
@kudoamv 4 жыл бұрын
Works like a charm
@lholhofox
@lholhofox Жыл бұрын
Thank you for the video!! Keep it up!!
@WolfBoy2700
@WolfBoy2700 5 жыл бұрын
Very useful thank you!
@3dmagix
@3dmagix 5 жыл бұрын
Great tutorial and I love your accent! I keep hearing "egg smell" when you say XML. :)
@RomeoMihalcea
@RomeoMihalcea 5 жыл бұрын
Or "Geogl" :))
@shokoufehsafa5987
@shokoufehsafa5987 Жыл бұрын
very useful thanx
@sarvarnishonboyev4233
@sarvarnishonboyev4233 3 жыл бұрын
Nice video. Are you from Scotland? :)
@ShivangiSingh-wc3gk
@ShivangiSingh-wc3gk 4 жыл бұрын
Please can you make a video on how and why we set up the paths?
@eljapi9346
@eljapi9346 3 жыл бұрын
:c
@manjeshk11
@manjeshk11 4 жыл бұрын
Hi Elliot, I followed your tutorial and generated person.pb.go successfully but when trying to execute the code in main.go file like you, getting the error like "./main.go:14:12: undefined: Person'. Please help me in this same as i am a beginner in golang. Thanks in advance.
@Ravi-Singh-001
@Ravi-Singh-001 4 жыл бұрын
is there a tutorial with Python?
@pricesmith1793
@pricesmith1793 3 жыл бұрын
I know this is beyond the scope of this lecture, but anyone know about grpc/protobuf schema stitching? Sort of like Apollo Federation or Google's Rejoiner. I'm kind of a newb working on a project, and one of my services is essentially a client to about 15-20 different api's. I'd love to only have a single unified layer expose that service to the rest of the services. Hopefully that makes sense!
@edtix
@edtix 4 жыл бұрын
What is this line exactly doing? newElliot = &Person{} It points to address of Person struct? It seems to be unreasonable. Is there other use of & at the beginning of type?
@vibhordubey1549
@vibhordubey1549 4 жыл бұрын
@Ed Tix It is creating object alternative code can be obj :=new(Person)
@levigame1657
@levigame1657 4 жыл бұрын
what' your IDE tool?
@Tutorialedge
@Tutorialedge 4 жыл бұрын
Visual Studio code! :)
@syberian_tyger
@syberian_tyger 4 жыл бұрын
How do you made coloured ()?
@Tutorialedge
@Tutorialedge 4 жыл бұрын
The Bracket Pair Colorizer extension for visual studio code handles this for me! A very handy tool when trying to quickly scan over code! :D
@christianhowell8283
@christianhowell8283 2 жыл бұрын
I am so thankful you asked this question and thank you @TutorialEdge for bringing this extension to my attention
@ruudkamphuis9322
@ruudkamphuis9322 5 жыл бұрын
Thanks but please increase the fontsize
@Tutorialedge
@Tutorialedge 5 жыл бұрын
Thank you for the feedback, I will try to improve font size in my future videos!
@mattwallington5363
@mattwallington5363 4 жыл бұрын
You forgot to circle back around to the final size of your serialized object using protobufs rather than XML or JSON. Looks like the final size of the original object that includes your name and age came out to 10 bytes. Compared to 35 bytes for JSON and 56 bytes for XML.
@Tutorialedge
@Tutorialedge 4 жыл бұрын
Good catch!, Thanks for doing the math and highlighting this!
@mattwallington5363
@mattwallington5363 4 жыл бұрын
@@Tutorialedge Forgot to add that it is a great tutorial!
@tristaneastburn3394
@tristaneastburn3394 6 ай бұрын
Most of the cli steps don't work anymore as far as I can tell. This video is 5 years old I didn't really expect it to still work.
@RyanKearney0
@RyanKearney0 5 жыл бұрын
Good thing we used a 32 bit integer for the persons age. As we all know it's not uncommon for humans to reach billions of years old.
@Tutorialedge
@Tutorialedge 5 жыл бұрын
You might be calculating age in seconds? ¯\_(ツ)_/¯
@TheRobdra
@TheRobdra 4 жыл бұрын
depending on the number stored, it may encode to just one byte because it's a varint under the hood(not including the "tag" of the field) developers.google.com/protocol-buffers/docs/encoding
@anshjoshi7362
@anshjoshi7362 2 жыл бұрын
Just 1 recommendation, if anyone has been getting package as __ in person.pb.go. I encountered the same problem and the way to resolve that is to put option go_package = "./;main"; in person.proto file Happy learning...
Securing Your Go REST APIs with JSON Web Tokens(JWTS)
22:42
TutorialEdge
Рет қаралды 79 М.
Beginners Guide to gRPC in Go!
18:15
TutorialEdge
Рет қаралды 132 М.
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 43 МЛН
Gym belt !! 😂😂  @kauermotta
00:10
Tibo InShape
Рет қаралды 17 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
justforfunc #30: The Basics of Protocol Buffers
28:31
justforfunc: Programming in Go
Рет қаралды 46 М.
13 Introduction to gRPC and Protocol Buffers
32:07
Nic Jackson
Рет қаралды 58 М.
What is gRPC? (Remote Procedure Calls)
7:16
IBM Technology
Рет қаралды 209 М.
Go + Microservices = Go Kit [I] - Peter Bourgon, Go Kit
38:49
CNCF [Cloud Native Computing Foundation]
Рет қаралды 102 М.
How Data Validation Nearly Destroyed Protobuf
6:03
CompSciGuy
Рет қаралды 2,7 М.
Pydantic is all you need: Jason Liu
17:55
AI Engineer
Рет қаралды 173 М.
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 43 МЛН