Skip to content

Commit

Permalink
Better protos for goref:
Browse files Browse the repository at this point in the history
- Use go generate instead of a shell script.
- Ref and Position are now in a proto under goref/proto.
  • Loading branch information
korfuri committed Jul 14, 2017
1 parent e684901 commit f59cd72
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 248 deletions.
5 changes: 5 additions & 0 deletions cmd/serve/proto/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//go:generate protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. serve.proto
//go:generate protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. serve.proto
//go:generate protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:. serve.proto

package serve
18 changes: 0 additions & 18 deletions cmd/serve/proto/protoc.sh

This file was deleted.

186 changes: 25 additions & 161 deletions cmd/serve/proto/serve.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 2 additions & 25 deletions cmd/serve/proto/serve.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";

import "google/api/annotations.proto";
import "github.com/korfuri/goref/proto/ref.proto";

package serve;

Expand All @@ -19,31 +20,7 @@ message GetAnnotationsRequest {

message GetAnnotationsResponse {
string path = 1;
repeated Annotation annotation = 2;
}

message Annotation {
Location from = 1;
Location to = 2;
Type type = 3;
}

message Location {
string package = 1;
string filename = 2;
int64 start_line = 3;
int64 start_column = 4;
int64 end_line = 5;
int64 end_column = 6;
}

enum Type {
Instantiation = 0;
Call = 1;
Implementation = 2;
Extension = 3;
Import = 4;
Reference = 5;
repeated goref.proto.Ref annotation = 2;
}

service Goref {
Expand Down
Loading

0 comments on commit f59cd72

Please sign in to comment.