All Projects → amsokol → mongo-go-driver-protobuf

amsokol / mongo-go-driver-protobuf

Licence: Apache-2.0 license
This is extension for MongoDB Go driver adds support for Google protocol buffers types

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Batchfile
5799 projects

mongo-go-driver-protobuf

This is extension for officional MongoDB Go driver adds support for Google protocol buffers types.

Description

It contains set of BSON marshal/unmarshal codecs for Google protocol buffers type wrappers, Timestamp and MongoDB ObjectID:

  • BoolValue
  • BytesValue
  • DoubleValue
  • FloatValue
  • Int32Value
  • Int64Value
  • StringValue
  • Uint32Value
  • Uint64Value
  • Timestamp
  • ObjectID

Links

Requirements

  • Google protocol buffers version proto3
  • Official MongoDB Go Driver RC1 or higher

Installation

Installing using go get:

go get -u github.com/amsokol/mongo-go-driver-protobuf

or you don't need to do anything manually if you are using Go modules. Go modules installs necessary packages automatically.

Usage example

First install protoc-gen-gotag to make available Go language tags for proto messages

go get -u github.com/amsokol/protoc-gen-gotag

Next

  1. Create free Altas mini MongoDB instance
  2. Create experiments database
  3. Create proto collection into experiments database
  4. Run this example
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].