Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wy-z/tproto
Parse golang data structure into proto3.
https://github.com/wy-z/tproto
ast go grpc json-schema protobuf
Last synced: about 5 hours ago
JSON representation
Parse golang data structure into proto3.
- Host: GitHub
- URL: https://github.com/wy-z/tproto
- Owner: wy-z
- License: mit
- Created: 2017-09-10T07:59:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T09:33:42.000Z (almost 7 years ago)
- Last Synced: 2024-06-20T16:48:27.465Z (5 months ago)
- Topics: ast, go, grpc, json-schema, protobuf
- Language: Go
- Homepage:
- Size: 9.31 MB
- Stars: 11
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tproto
[![Build Status](https://travis-ci.org/wy-z/tproto.svg?branch=master)](https://travis-ci.org/wy-z/tproto) [![GoDoc](https://godoc.org/github.com/wy-z/tproto?status.svg)](http://godoc.org/github.com/wy-z/tproto) [![Go Report Card](https://goreportcard.com/badge/github.com/wy-z/tproto)](https://goreportcard.com/report/github.com/wy-z/tproto)Parse golang data structure into proto3.
## Installation
```
go get github.com/wy-z/tproto/...
```
Or
```
import "github.com/wy-z/tproto/tproto" # see cmd/tproto/cli.go
```## Usage
```
NAME:
tproto - Parse golang data structure into proto3.USAGE:
tproto [global options] command [command options] [arguments...]VERSION:
1.2.3COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--package PKG, -p PKG package path PKG (default: ".")
--expressions EXPRS, --exprs EXPRS (any-of required) type expressions, seperated by ',' EXPRS
--decorator DECORATOR, -d DECORATOR (any-of required) parse package with decorator DECORATOR
--proto-package PP, --pp PP (required) proto package PP
--proto-file PF, --pf PF load messages from proto file PF
--json-tag, --jt don't ignore json tag
--help, -h show help
--version, -v print the version
```## QuickStart
`tproto -p github.com/wy-z/tproto/samples -exprs BasicTypes,NormalStruct -pp samples`
Or
`tproto -p github.com/wy-z/tproto/samples -pp samples BasicTypes NormalStruct`## Samples
see `github.com/wy-z/tproto/samples/source`
## Test
```
go get -u github.com/jteeuwen/go-bindata/...
go generate ./samples && go test -v ./tproto
```