Getting started
Basic types
Variables
Constants
Strings
Pointers
Arrays
Slices
Maps
Structs
Interfaces
Empty interface
if, switch, goto
for, while loops
range statement
Functions
Methods
Error handling
Defer
Panic and recover
Concurrency
Channels and select
Mutex
Packages
Files and I/O
Time and date
Command line arguments
Logging
Executing commands
Hex, base64 encoding
JSON
XML
CSV
YAML
SQL
HTTP Client
HTTP Server
Text and HTML templates
Reflection
Context
Package fmt
OS Signals
Testing
Calling C from GO with cgo
Profiling using go tool pprof
Cross compilation
Conditional compilation with build tags
Inlining functions
sync.Pool for better performance
gob
Plugin
HTTP server middleware
Protobuf in Go
Console I/O
Cryptography
Images (PNG, JPEG, BMP, TIFF, WEBP, VP8, GIF)
The Go Command
Testing code with CI services
Windows GUI programming
Contributors

Protobuf in Go

suggest change

Introduction

Protobuf or Protocol Buffer encodes and decodes data so that different applications or modules written in unlike languages can exchange large numbers of messages quickly and reliably without overloading the communication channel. With protobuf, the performance is directly proportional to the number of message you tend to send. It compresses the message to to be sent into a serialized binary format by providing you with the tools to encode the message at the source and decode it at the destination.

Remarks

There are two steps of using protobuf.

  1. First you must compile the protocol buffer definitions
  2. Import the above definitions, with the support library into your program.

gRPC Support

If a proto file specifies RPC services, protoc-gen-go can be instructed to generate code compatible with gRPC (http://www.grpc.io/). To do this, pass the plugins parameter to protoc-gen-go; the usual way is to insert it into the –go_out argument to protoc:

$ protoc --go_out=plugins=grpc:. *.proto

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents