Skip to content
Permalink
Browse files

add grpc-gateway

  • Loading branch information...
birdayz committed Dec 3, 2018
1 parent 213982a commit 89b774bd9dd5541b1354c8354d14cba8816494e5

Some generated files are not rendered by default. Learn more.

@@ -5,10 +5,46 @@ package infinimesh.api;
option go_package = "apipb";

import "pkg/registry/registrypb/device_registry.proto";
import "protoc-gen-swagger/options/annotations.proto";
import "google/api/annotations.proto";

option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
host: "api.infinimesh.io";
info: {
title: "Infinimesh IoT Platform";
description: "Cloud Native IoT Platform";
version: "0.0.1";
contact: {
name: "Infinimesh";
url: "http://infinimesh.io";
email: "joe@infinimesh.io";
};
};
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
};

service Devices {
rpc Create(infinimesh.deviceregistry.CreateRequest) returns (infinimesh.deviceregistry.CreateResponse);
rpc GetByName(infinimesh.deviceregistry.GetByNameRequest) returns (infinimesh.deviceregistry.GetByNameResponse);
rpc List(infinimesh.deviceregistry.ListDevicesRequest) returns (infinimesh.deviceregistry.ListResponse);
rpc Delete(infinimesh.deviceregistry.DeleteRequest) returns (infinimesh.deviceregistry.DeleteResponse);
rpc Create(infinimesh.deviceregistry.CreateRequest) returns (infinimesh.deviceregistry.CreateResponse) {
option (google.api.http) = {
post: "/devices"
body: "device"
};
};
rpc GetByName(infinimesh.deviceregistry.GetByNameRequest) returns (infinimesh.deviceregistry.GetByNameResponse) {
option (google.api.http) = {
get: "/devices/{name}"
};
};
rpc List(infinimesh.deviceregistry.ListDevicesRequest) returns (infinimesh.deviceregistry.ListResponse) {
option (google.api.http) = {
get: "/devices"
};
}
rpc Delete(infinimesh.deviceregistry.DeleteRequest) returns (infinimesh.deviceregistry.DeleteResponse) {
option (google.api.http) = {
delete: "/devices/{name}"
};
};
}
@@ -3,6 +3,8 @@ excludes:

protoc:
version: 3.6.1
includes:
- tools/proto/

lint:
rules:
@@ -15,6 +17,9 @@ lint:
generate:
go_options:
import_path: "github.com/infinimesh/infinimesh"
extra_modifiers:
google/api/annotations.proto: google.golang.org/genproto/googleapis/api/annotations
google/api/http.proto: google.golang.org/genproto/googleapis/api/annotations
plugins:
- name: go
type: go
@@ -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 = "google.golang.org/genproto/googleapis/api/annotations;annotations";
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;
}

0 comments on commit 89b774b

Please sign in to comment.
You can’t perform that action at this time.