Skip to content

Commit

Permalink
moved formatter and all commands to proto-contrib package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Micklei committed Jan 1, 2018
1 parent c5ae975 commit 31b24c2
Show file tree
Hide file tree
Showing 41 changed files with 9 additions and 5,337 deletions.
55 changes: 8 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

Package in Go for parsing Google Protocol Buffers [.proto files version 2 + 3] (https://developers.google.com/protocol-buffers/docs/reference/proto3-spec)

This repository also includes 3 commands. The `protofmt` tool is for formatting .proto files. The `proto2xsd` tool is for generating XSD files from .proto version 3 files. The `proto2gql` tool is for generating the GraphQL Schema.
### install

### usage as package
go get -u -v github.com/emicklei/proto

### usage

package main

Expand All @@ -23,56 +25,15 @@ This repository also includes 3 commands. The `protofmt` tool is for formatting
defer reader.Close()
parser := proto.NewParser(reader)
definition, _ := parser.Parse()
formatter := proto.NewFormatter(os.Stdout, " ")
formatter.Format(definition)
log.Println(definition)
}

### usage of proto2xsd command

> proto2xsd -help
Usage of proto2xsd [flags] [path ...]
-ns string
namespace of the target types (default "http://your.company.com/domain/version")
-w write result to an XSD files instead of stdout

See folder `cmd/proto2xsd/README.md` for more details.

### usage of proto2gql command

> proto2gql -help
Usage of proto2gql [flags] [path ...]

-std_out
Writes transformed files to stdout
-txt_out string
Writes transformed files to .graphql file
-go_out string
Writes transformed files to .go file
-js_out string
Writes transformed files to .js file
-package_alias value
Renames packages using given aliases
-resolve_import value
Resolves given external packages
-no_prefix
Disables package prefix for type names
### contributions

See folder `cmd/proto2gql/README.md` for more details.

### usage of protofmt command

> protofmt -help
Usage of protofmt [flags] [path ...]
-w write result to (source) files instead of stdout

See folder `cmd/protofmt/README.md` for more details.

### how to install

go get -u -v github.com/emicklei/proto
See (https://github.com/emicklei/proto-contrib) for contributions on top of this package such as protofmt, proto2xsd and proto2gql.

#### known issues

- the proto2 test file in protofmt folder contains character escape sequences that are currently not accepted by the scanner. See line 537 and 573.
- the proto2 test file in (https://github.com/emicklei/proto-contrib/cmd/protofmt) folder contains character escape sequences that are currently not accepted by the scanner. See line 537 and 573.

© 2017, [ernestmicklei.com](http://ernestmicklei.com). MIT License. Contributions welcome.
73 changes: 0 additions & 73 deletions aligned.go

This file was deleted.

9 changes: 0 additions & 9 deletions cmd/proto2gql/Makefile

This file was deleted.

24 changes: 0 additions & 24 deletions cmd/proto2gql/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions cmd/proto2gql/converter.go

This file was deleted.

78 changes: 0 additions & 78 deletions cmd/proto2gql/file.go

This file was deleted.

Loading

0 comments on commit 31b24c2

Please sign in to comment.