Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ekhabarov/stp

Convert Go structures into Protobuf messages.
https://github.com/ekhabarov/stp

convertor generator go golang protobuf protocol-buffers

Last synced: 4 days ago
JSON representation

Convert Go structures into Protobuf messages.

Awesome Lists containing this project

README

        

# Convert Go structures into Protobuf messages.

## Installation

```shell
go get -u github.com/ekhabarov/stp
```

## Example

Go struct from [example/example.go](./example/example.go)
```go
type SomeStruct struct {
ID int
Name string
Address string
Status string
}
```
command

```shell
stp -f $GOPATH/src/github.com/ekhabarov/stp/example/example.go -s SomeStruct
```

prints

```shell
message SomeStruct {
int id = 1;
string name = 2;
string address = 3;
string status = 4;
}
```

## Usage
```shell
Usage of stp:
-f string
/path/to/file.go with structures
-s string
Structure name to parse
```