Monday, 17 August 2015 12:42
From Wikipedia: Protocol Buffers is a method of serializing structured data. It is useful in developing programs to communicate with each other over a wire or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates source code from that description for generating or parsing a stream of bytes that represents the structured data.
Wednesday, 19 August 2015 17:43
This documents how to generate the language specific code / packages from the .proto files.
The proto2 Language Guide does not include syntax fro Go. The proto3 Language Guide does include Go, and the "protoc" syntax doesn't appear to have changed. This syntax DOES work with Go, so here's the documentation for proto3:
protoc --proto_path=IMPORT_PATH --cpp_out=DST_DIR --java_out=DST_DIR --python_out=DST_DIR --go_out=DST_DIR --ruby_out=DST_DIR --javanano_out=DST_DIR path/to/file.proto
IMPORT_PATH specifies a directory in which to look for .proto files when resolving import directives. If omitted, the current directory is used. Multiple import directories can be specified by passing the --proto_path option multiple times; they will be searched in order.
-I=IMPORT_PATH can be used as a short form of
- You can provide one or more output directives:
--cpp_outgenerates C++ code in DST_DIR. See the C++ generated code reference for more.
--java_outgenerates Java code in DST_DIR. See the Java generated code reference for more.
--python_outgenerates Python code in DST_DIR. See the Python generated code reference for more.
--go_outgenerates Go code in DST_DIR. Go generated code reference is coming soon!
--ruby_outgenerates Ruby code in DST_DIR. Ruby generated code reference is coming soon!
--javanano_outgenerates JavaNano code in DST_DIR. The JavaNano code generator has a number of options you can use to customize the generator output: you can find out more about these in the generator README. JavaNano generated code reference is coming soon!
As an extra convenience, if the
DST_DIR ends in
.jar, the compiler will write the output to a single ZIP-format archive file with the given name.
.jar outputs will also be given a manifest file as required by the
Java JAR specification. Note that if the output archive already exists, it will be overwritten; the compiler is not smart enough to add files to an existing archive.
* You must provide one or more
.proto files as input. Multiple
.proto files can be specified at once. Although the files are named relative to the current directory, each file must reside in one of the
IMPORT_PATHs so that the compiler can determine its canonical name.
Monday, 17 August 2015 13:08
Type Parametric Functions
Channels and Select
Friday, 04 September 2015 13:48
Thursday, 20 August 2015 16:36
- database/sql - The primary Go relational database connector, and is a Go Project package.
- database/sql Tutorial
The database/sql and database/sql/driver packages are designed for using databases from Go and implementing database drivers, respectively. See the design goals doc:
Tuesday, 25 August 2015 15:06
This library implements a cron spec parser and runner. Uses a standard cron type syntax for job scheduling.
From the documentation:
Tuesday, 25 August 2015 16:48
Friday, 04 September 2015 14:05
Monday, 17 August 2015 13:16
Thursday, 27 August 2015 19:08
The following are some of the people and resources I have found to be valuable for learning Go:
- Eleanor McHugh
- Mat Ryer - author of "Go Programming Blueprints"
- Nathan LeClaire - articles on Go, Docker, Angular, etc.
- Adam Presley
- Alex Edwards