Skip to content

Commit

Permalink
google/api
Browse files Browse the repository at this point in the history
  • Loading branch information
awalterschulze committed Feb 8, 2018
1 parent 9604362 commit 262acac
Show file tree
Hide file tree
Showing 8 changed files with 2,638 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
before_install:
- ./install-protobuf.sh
- PATH=/home/travis/bin:$PATH protoc --version
- go get github.com/gogo/protobuf/protoc-gen-gogo/descriptor
- go get github.com/gogo/protobuf/types
- go get github.com/gogo/protobuf/protoc-gen-gogotypes
- go get github.com/gogo/protobuf/gogoreplace
Expand Down
28 changes: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ test:
go test ./...

regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogotypes
go install github.com/gogo/googleapis/protoc-gen-gogogoogleapis

protoc \
--gogotypes_out=\
--gogogoogleapis_out=\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
:. \
-I=. \
google/rpc/status.proto \
google/rpc/error_details.proto \
google/rpc/code.proto
google/rpc/code.proto \

protoc \
--gogogoogleapis_out=\
Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\
:. \
-I=. \
google/api/http.proto \
google/api/annotations.proto

update:
go install github.com/gogo/protobuf/gogoreplace
Expand All @@ -35,4 +43,16 @@ update:
gogoreplace \
'option go_package = "google.golang.org/genproto/googleapis/rpc/code;code";' \
'option go_package = "rpc";' \
./google/rpc/code.proto
./google/rpc/code.proto

(cd ./google/api && rm http.proto; wget ${URL}/google/api/http.proto)
gogoreplace \
'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \
'option go_package = "api";' \
./google/api/http.proto

(cd ./google/api && rm annotations.proto; wget ${URL}/google/api/annotations.proto)
gogoreplace \
'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \
'option go_package = "api";' \
./google/api/annotations.proto
48 changes: 48 additions & 0 deletions google/api/annotations.pb.go

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

31 changes: 31 additions & 0 deletions google/api/annotations.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2015, Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.api;

import "google/api/http.proto";
import "google/protobuf/descriptor.proto";

option go_package = "api";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
}
7 changes: 7 additions & 0 deletions google/api/api_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package api

import "testing"

func TestAPI(t *testing.T) {

}
Loading

0 comments on commit 262acac

Please sign in to comment.