protoc-gen-json-field

command
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 6 Imported by: 0

README

protoc-gen-json-field

Generate json code based on proto files.


Installation

Installation of dependency plugins
# install protoc in linux
mkdir -p protocDir \
  && curl -L -o protocDir/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-linux-x86_64.zip \
  && unzip protocDir/protoc.zip -d protocDir\
  && mv protocDir/bin/protoc protocDir/include/ $GOROOT/bin/ \
  && rm -rf protocDir
Install protoc-gen-json-field

go install github.com/18721889353/sunshine/cmd/protoc-gen-json-field@latest


Usage

# generate json file
protoc --proto_path=. --json-field_out=. --json-field_opt=paths=source_relative demo.proto

Documentation

Overview

Package main is a library that parses protobuf files into json

Directories

Path Synopsis
Package generate is generate json field code.
Package generate is generate json field code.
Package parser is parsed proto file to struct
Package parser is parsed proto file to struct

Jump to

Keyboard shortcuts

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