[gRPC #9.1] Serialize protobuf message - Golang

  Рет қаралды 19,770

TECH SCHOOL

TECH SCHOOL

Күн бұрын

Пікірлер: 26
@apoorvamishra5952
@apoorvamishra5952 3 жыл бұрын
Awesome Content , thanks for that :) I think if you are in same package you don't need to import it in test files, rather just use the name of the function given the name of the function starts with caps.
@TECHSCHOOLGURU
@TECHSCHOOLGURU 3 жыл бұрын
Thanks! Good tip!
@johnnychang3456
@johnnychang3456 2 жыл бұрын
This is high quality Go code. Thank you!
@TECHSCHOOLGURU
@TECHSCHOOLGURU 2 жыл бұрын
Enjoy!
@rodrigodonizettideoliveira6102
@rodrigodonizettideoliveira6102 3 жыл бұрын
I was facing the following issue: "cannot use message (type protoreflect.ProtoMessage) as type protoiface.MessageV1 in argument to marshaler.MarshalToString". I guess it was due to version mismatching. Pay attention to the imports and change the ProtobufToJson function to: import ( "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" ) func ProtobufToJson(message proto.Message) (string, error) { marshaler := protojson.MarshalOptions{ UseEnumNumbers: false, EmitUnpopulated: true, Indent: " ", UseProtoNames: true, } data, err := marshaler.Marshal(message) return string(data), err } github.com/golang/protobuf/issues/1133 Thank you very much for sharing your knowledge with us!
@TECHSCHOOLGURU
@TECHSCHOOLGURU 3 жыл бұрын
Thanks Rodrigo. Indeed there might be some differences in the generated code if you use different versions of protobuf.
@nhattrungvodai2525
@nhattrungvodai2525 2 жыл бұрын
Great Content . Thank you so much !
@TECHSCHOOLGURU
@TECHSCHOOLGURU 2 жыл бұрын
Glad you liked it!
@idirdev3729
@idirdev3729 4 жыл бұрын
Thanks for these great resources.
@TECHSCHOOLGURU
@TECHSCHOOLGURU 4 жыл бұрын
Glad you like them!
@SriRam-fk9fq
@SriRam-fk9fq 3 жыл бұрын
One of the best resources for gRPC! I purchased this course on Udemy as well. Do you have any plans to expand your tutorials, especially the Go programming language itself? If so, that would be great!
@TECHSCHOOLGURU
@TECHSCHOOLGURU 3 жыл бұрын
Thanks so much, Sri! You can find more tutorials in our youtube channel: kzbin.info This is the backend master course with Golang: kzbin.info/aero/PLy_6D98if3ULEtXtNSY_2qN21VCKgoQAE
@nossandra
@nossandra 4 жыл бұрын
Thank you very much!
@TECHSCHOOLGURU
@TECHSCHOOLGURU 4 жыл бұрын
Thanks!
@Marlem80
@Marlem80 2 жыл бұрын
I guess jsonpb is deprecated, right? I used protojson instead...
@tlgki
@tlgki 3 жыл бұрын
e thấy a có viết func xong nó tự điền import đó ạ, không biết nó là extention gì e tìm không thấy a.
@TECHSCHOOLGURU
@TECHSCHOOLGURU 3 жыл бұрын
Hi Kiên, Anh thấy chỉ cần cài golang plugin của vscode, sau đó nó sẽ install một số package của go để có tự động import & auto complete. Em có thể xem video này cho rõ hơn: kzbin.info/www/bejne/oIOvh2BnfLt4ipY
@magnifico689
@magnifico689 5 жыл бұрын
Can you also do with nodejs.
@TECHSCHOOLGURU
@TECHSCHOOLGURU 5 жыл бұрын
Thanks Jerry for the suggestion. However, it's not in the scope of this course at the moment. I believe doing this for NodeJS would be very similar to Go or Java.
@ArjunTiwari91
@ArjunTiwari91 3 жыл бұрын
I am getting access denied error while running go test ./... maybe because I dont have permisiion to change the file
@AbhishekVaid
@AbhishekVaid 3 жыл бұрын
In Json serialization we have value (uint64) serialized as string. Why is that the case ?
3 ай бұрын
A bit late, however if somebody is interested in the answer. Interoperability as defined by rfc7159. Although technically JSON has no precision limits on numbers, JavaScript and other languages do: 2^53. Unfortunately unit64 falls outside of that range.
@AbhishekVaid
@AbhishekVaid 4 жыл бұрын
Hey how do I find you on linkedin ?
@TECHSCHOOLGURU
@TECHSCHOOLGURU 4 жыл бұрын
Hi Abhishek, you can find Tech School on Linkedin at this link: www.linkedin.com/company/34649008/admin/
@MarekCzechyra
@MarekCzechyra 4 жыл бұрын
Does anybody else have problem with donwload and clone sources from repo on GitLab? I still get message from browser: 429 Too many requests received, and for git from commnd line: git clone git@gitlab.com:techschool/pcbook.git Cloning into 'pcbook'... git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
@TECHSCHOOLGURU
@TECHSCHOOLGURU 4 жыл бұрын
Hi Marek, if you haven't set up SSH key for your gitlab account, you should clone by HTTPS instead: git clone gitlab.com/techschool/pcbook.git
[gRPC #9.2] Serialize protobuf message - Java
15:29
TECH SCHOOL
Рет қаралды 11 М.
[gRPC #10.1] Implement unary gRPC API - Golang
33:00
TECH SCHOOL
Рет қаралды 19 М.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,3 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 132 МЛН
Beginners Guide to gRPC in Go!
18:15
TutorialEdge
Рет қаралды 139 М.
[gRPC #8] Config Gradle to generate Java code from protobuf
11:14
[gRPC #11.1] Implement server-streaming gRPC API - Golang
16:21
TECH SCHOOL
Рет қаралды 14 М.
What is gRPC? (Remote Procedure Calls)
7:16
IBM Technology
Рет қаралды 223 М.
[gRPC #7] Protobuf deep-dive and Go package option
11:42
TECH SCHOOL
Рет қаралды 26 М.
[gRPC #10.2] Implement unary gRPC API - Java
25:12
TECH SCHOOL
Рет қаралды 7 М.
The Power Of Golang's Decorator Pattern
14:09
Anthony GG
Рет қаралды 50 М.