pbconv

command module
v0.0.0-...-c98a1e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

pbconv

Protocol Buffers data-format conversion utility.

This supports:

  • pbconv from-proto : Convert JSON or Protocol Buffers Text-format into binary of Protocol Buffers wire format
  • pbconv to-proto : Convert binary of Protocol Buffers wire format into JSON or Text-format

Installation

$ go install github.com/thara/pbconv@latest

Example

sample proto file

syntax = "proto3";

package dev.thara.book;

message Book {
    int64 isbn = 1;
    string title = 2;
    string author = 3;
    bool published = 4;
}
Generate binary of Protocol Buffers wire format from JSON
$ cat book.json
{
  "isbn": 123,
  "title": "sample",
  "author": "Tom",
  "published": true
}
$ cat book.json | pbconv to-proto --from json --out book.bin Book book.proto
Show contents of Protocol Buffers wire format by Text-format
$ pbconv from-proto --in book.bin --to text Book book.proto
isbn: 123
title: "sample"
author: "Tom"
published: true

Author

Tomochika Hara https://thara.dev

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址