diff --git a/example/hello-world/.gitignore b/example/hello-world/.gitignore deleted file mode 100644 index 55283c232..000000000 --- a/example/hello-world/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/hello-world-idl diff --git a/example/hello-world/go.mod b/example/hello-world/go.mod deleted file mode 100644 index 24427fed8..000000000 --- a/example/hello-world/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/yourrepo/hello-world - -go 1.12 - -replace github.com/yourrepo/hello-world-idl => ./hello-world-idl - -require ( - github.com/grpc-ecosystem/grpc-gateway v1.11.3 // indirect - github.com/yourrepo/hello-world-idl v0.0.0 - google.golang.org/appengine v1.4.0 // indirect - google.golang.org/genproto v0.0.0-20191002211648-c459b9ce5143 // indirect - google.golang.org/grpc v1.24.0 // indirect -) diff --git a/example/hello-world/go.sum b/example/hello-world/go.sum deleted file mode 100644 index 427acc122..000000000 --- a/example/hello-world/go.sum +++ /dev/null @@ -1,54 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/grpc-ecosystem/grpc-gateway v1.11.3 h1:h8+NsYENhxNTuq+dobk3+ODoJtwY4Fu0WQXsxJfL8aM= -github.com/grpc-ecosystem/grpc-gateway v1.11.3/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20191002211648-c459b9ce5143 h1:tikhlQEJeezbnu0Zcblj7g5vm/L7xt6g1vnfq8mRCS4= -google.golang.org/genproto v0.0.0-20191002211648-c459b9ce5143/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/example/hello-world/hello-world-idl/Makefile b/example/hello-world/hello-world-idl/Makefile deleted file mode 100644 index 20e02c511..000000000 --- a/example/hello-world/hello-world-idl/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -PROTOC_VERSION := 3.9.2 -PROTOC_WEB_VERSION := 1.0.6 - -PROTO_SOURCES := -I /usr/local/include -PROTO_SOURCES += -I . -PROTO_SOURCES += -I ${GOPATH}/src -PROTO_SOURCES += -I ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -PROTO_SOURCES += -I ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway - -deps-linux: deps-protoc-linux deps-grpc-web-linux deps-go - -deps-protoc-linux: - curl -OL https://github.com/google/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-linux-x86_64.zip - unzip protoc-$(PROTOC_VERSION)-linux-x86_64.zip -d protoc3 - sudo mv protoc3/bin/* /usr/local/bin/ - sudo mv protoc3/include/* /usr/local/include/ - rm -rf protoc3 protoc-$(PROTOC_VERSION)-linux-x86_64.zip - -deps-grpc-web-linux: - curl -OL https://github.com/grpc/grpc-web/releases/download/$(PROTOC_WEB_VERSION)/protoc-gen-grpc-web-$(PROTOC_WEB_VERSION)-linux-x86_64 - sudo mv protoc-gen-grpc-web-$(PROTOC_WEB_VERSION)-linux-x86_64 /usr/local/bin/protoc-gen-grpc-web - chmod +x /usr/local/bin/protoc-gen-grpc-web - -deps-go: - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger - go get -u github.com/golang/protobuf/protoc-gen-go - -generate: generate-grpc generate-web generate-http - -generate-grpc: - mkdir -p gen/go - protoc ${PROTO_SOURCES} --go_out=plugins=grpc,paths=source_relative:proto ./proto/health/*.proto - protoc ${PROTO_SOURCES} --go_out=plugins=grpc,paths=source_relative:proto ./proto/helloworld/*.proto - cp -f -rv proto/proto/* gen/go - rm -rf proto/proto -generate-web: - mkdir -p gen/web - protoc ${PROTO_SOURCES} --grpc-web_out=import_style=typescript,mode=grpcwebtext:proto ./proto/health/*.proto - protoc ${PROTO_SOURCES} --grpc-web_out=import_style=typescript,mode=grpcwebtext:proto ./proto/helloworld/*.proto - cp -f -rv proto/proto/* gen/web - cp -f -rv proto/Proto/* gen/web - rm -rf proto/proto proto/Proto -generate-http: - mkdir -p gen/http - protoc ${PROTO_SOURCES} --grpc-gateway_out=logtostderr=true,paths=source_relative:proto --swagger_out=logtostderr=true:proto ./proto/health/*.proto - protoc ${PROTO_SOURCES} --grpc-gateway_out=logtostderr=true,paths=source_relative:proto --swagger_out=logtostderr=true:proto ./proto/helloworld/*.proto - cp -f -rv proto/proto/* gen/http - rm -rf proto/proto - diff --git a/example/hello-world/hello-world-idl/gen/go/health/health.pb.go b/example/hello-world/hello-world-idl/gen/go/health/health.pb.go deleted file mode 100644 index b203ec123..000000000 --- a/example/hello-world/hello-world-idl/gen/go/health/health.pb.go +++ /dev/null @@ -1,314 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: proto/health/health.proto - -package health - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 - HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 -) - -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", - 3: "SERVICE_UNKNOWN", -} - -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, - "SERVICE_UNKNOWN": 3, -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) -} - -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7bb2e9a145ccb86d, []int{1, 0} -} - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7bb2e9a145ccb86d, []int{0} -} - -func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckRequest.Unmarshal(m, b) -} -func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) -} -func (m *HealthCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckRequest.Merge(m, src) -} -func (m *HealthCheckRequest) XXX_Size() int { - return xxx_messageInfo_HealthCheckRequest.Size(m) -} -func (m *HealthCheckRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo - -func (m *HealthCheckRequest) GetService() string { - if m != nil { - return m.Service - } - return "" -} - -type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=health.HealthCheckResponse_ServingStatus" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7bb2e9a145ccb86d, []int{1} -} - -func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b) -} -func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) -} -func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckResponse.Merge(m, src) -} -func (m *HealthCheckResponse) XXX_Size() int { - return xxx_messageInfo_HealthCheckResponse.Size(m) -} -func (m *HealthCheckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo - -func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if m != nil { - return m.Status - } - return HealthCheckResponse_UNKNOWN -} - -func init() { - proto.RegisterEnum("health.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) - proto.RegisterType((*HealthCheckRequest)(nil), "health.HealthCheckRequest") - proto.RegisterType((*HealthCheckResponse)(nil), "health.HealthCheckResponse") -} - -func init() { proto.RegisterFile("proto/health/health.proto", fileDescriptor_7bb2e9a145ccb86d) } - -var fileDescriptor_7bb2e9a145ccb86d = []byte{ - // 350 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x41, 0x4e, 0xc2, 0x40, - 0x14, 0xb5, 0x10, 0x4a, 0xfc, 0x88, 0x90, 0xc1, 0x18, 0xac, 0x2e, 0x48, 0x57, 0x9a, 0xd8, 0x0e, - 0xe0, 0x09, 0x80, 0x10, 0x35, 0x9a, 0x92, 0x14, 0x94, 0xc4, 0x0d, 0x29, 0x65, 0x32, 0x6d, 0xac, - 0x9d, 0xda, 0x99, 0x42, 0xdc, 0x7a, 0x04, 0xbd, 0x81, 0x3b, 0xcf, 0xe3, 0x15, 0x3c, 0x88, 0x61, - 0xda, 0x2e, 0x88, 0xc4, 0x85, 0xab, 0x9f, 0xf7, 0xff, 0x7b, 0x6f, 0xde, 0xe4, 0x7f, 0x38, 0x8a, - 0x62, 0x26, 0x18, 0xf6, 0x88, 0x13, 0x08, 0x2f, 0x2b, 0xa6, 0xec, 0x21, 0x35, 0x45, 0xda, 0x09, - 0x65, 0x8c, 0x06, 0x04, 0x3b, 0x91, 0x8f, 0x9d, 0x30, 0x64, 0xc2, 0x11, 0x3e, 0x0b, 0x79, 0xca, - 0xd2, 0xce, 0x65, 0x71, 0x0d, 0x4a, 0x42, 0x83, 0xaf, 0x1c, 0x4a, 0x49, 0x8c, 0x59, 0x24, 0x19, - 0xbf, 0xd9, 0xba, 0x09, 0xe8, 0x4a, 0xba, 0x0e, 0x3c, 0xe2, 0x3e, 0xda, 0xe4, 0x39, 0x21, 0x5c, - 0xa0, 0x26, 0x94, 0x39, 0x89, 0x97, 0xbe, 0x4b, 0x9a, 0x4a, 0x4b, 0x39, 0xdd, 0xb5, 0x73, 0xa8, - 0x7f, 0x2a, 0xd0, 0xd8, 0x10, 0xf0, 0x88, 0x85, 0x9c, 0xa0, 0x1e, 0xa8, 0x5c, 0x38, 0x22, 0xe1, - 0x52, 0xb0, 0xdf, 0x3d, 0x33, 0xb3, 0xe8, 0x5b, 0xc8, 0xe6, 0x78, 0x6d, 0x16, 0xd2, 0xb1, 0x14, - 0xd8, 0x99, 0x50, 0x1f, 0x41, 0x75, 0x63, 0x80, 0x2a, 0x50, 0xbe, 0xb3, 0x6e, 0xac, 0xd1, 0xd4, - 0xaa, 0xef, 0xac, 0xc1, 0x78, 0x68, 0xdf, 0x5f, 0x5b, 0x97, 0x75, 0x05, 0xd5, 0xa0, 0x62, 0x8d, - 0x26, 0xb3, 0xbc, 0x51, 0x40, 0x0d, 0xa8, 0x49, 0x30, 0x18, 0xce, 0x72, 0x49, 0xb1, 0xfb, 0xa1, - 0x80, 0x9a, 0x3e, 0x8f, 0x26, 0x50, 0x92, 0x11, 0x90, 0xb6, 0x35, 0x97, 0xfc, 0xb5, 0x76, 0xfc, - 0x47, 0x66, 0x1d, 0xbd, 0x7e, 0x7d, 0xbf, 0x17, 0xf6, 0x10, 0xe0, 0x65, 0x27, 0x5b, 0x0b, 0xea, - 0x43, 0x69, 0xea, 0x08, 0xd7, 0xfb, 0xb7, 0x6b, 0x5b, 0xe9, 0xdf, 0xbe, 0xf5, 0x0e, 0xd1, 0x01, - 0x54, 0xd3, 0x69, 0x4b, 0x8e, 0x79, 0xb7, 0xd8, 0x31, 0xdb, 0x0f, 0x1d, 0xea, 0x0b, 0x2f, 0x99, - 0x9b, 0x2e, 0x7b, 0xc2, 0x2f, 0x2c, 0x89, 0x63, 0x12, 0xad, 0x0f, 0x23, 0x08, 0x98, 0xb1, 0x62, - 0x71, 0xb0, 0x30, 0xfc, 0x45, 0x80, 0x29, 0x09, 0x31, 0xcd, 0xef, 0x65, 0xae, 0xca, 0xad, 0x5e, - 0xfc, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xfa, 0x76, 0x68, 0x46, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// HealthClient is the client API for Health service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type HealthClient interface { - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) - Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) -} - -type healthClient struct { - cc *grpc.ClientConn -} - -func NewHealthClient(cc *grpc.ClientConn) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, "/health.Health/Check", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &_Health_serviceDesc.Streams[0], "/health.Health/Watch", opts...) - if err != nil { - return nil, err - } - x := &healthWatchClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Health_WatchClient interface { - Recv() (*HealthCheckResponse, error) - grpc.ClientStream -} - -type healthWatchClient struct { - grpc.ClientStream -} - -func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) { - m := new(HealthCheckResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// HealthServer is the server API for Health service. -type HealthServer interface { - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) - Watch(*HealthCheckRequest, Health_WatchServer) error -} - -// UnimplementedHealthServer can be embedded to have forward compatible implementations. -type UnimplementedHealthServer struct { -} - -func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") -} -func (*UnimplementedHealthServer) Watch(req *HealthCheckRequest, srv Health_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} - -func RegisterHealthServer(s *grpc.Server, srv HealthServer) { - s.RegisterService(&_Health_serviceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/health.Health/Check", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(HealthCheckRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(HealthServer).Watch(m, &healthWatchServer{stream}) -} - -type Health_WatchServer interface { - Send(*HealthCheckResponse) error - grpc.ServerStream -} - -type healthWatchServer struct { - grpc.ServerStream -} - -func (x *healthWatchServer) Send(m *HealthCheckResponse) error { - return x.ServerStream.SendMsg(m) -} - -var _Health_serviceDesc = grpc.ServiceDesc{ - ServiceName: "health.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Health_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "proto/health/health.proto", -} diff --git a/example/hello-world/hello-world-idl/gen/go/helloworld/helloworld.pb.go b/example/hello-world/hello-world-idl/gen/go/helloworld/helloworld.pb.go deleted file mode 100644 index 1fac18020..000000000 --- a/example/hello-world/hello-world-idl/gen/go/helloworld/helloworld.pb.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: proto/helloworld/helloworld.proto - -package helloworld - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - health "github.com/yourrepo/hello-world-idl/gen/go/health" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -func init() { proto.RegisterFile("proto/helloworld/helloworld.proto", fileDescriptor_d16ac54e3a89a4f6) } - -var fileDescriptor_d16ac54e3a89a4f6 = []byte{ - // 229 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x28, 0xca, 0x2f, - 0xc9, 0xd7, 0xcf, 0x48, 0xcd, 0xc9, 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0x41, 0x62, 0xea, 0x81, - 0xe5, 0x84, 0xb8, 0x10, 0x22, 0x52, 0x92, 0x30, 0xe5, 0x89, 0x39, 0x25, 0x19, 0x50, 0x0a, 0xa2, - 0x4c, 0x4a, 0x26, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x3f, 0xb1, 0x20, 0x53, 0x3f, 0x31, 0x2f, - 0x2f, 0xbf, 0x24, 0xb1, 0x24, 0x33, 0x3f, 0xaf, 0x18, 0x2a, 0xab, 0x03, 0xa6, 0x92, 0x75, 0xd3, - 0x53, 0xf3, 0x74, 0x8b, 0xcb, 0x13, 0xd3, 0xd3, 0x53, 0x8b, 0xf4, 0xf3, 0x0b, 0xc0, 0x2a, 0x30, - 0x55, 0x1b, 0xe5, 0x72, 0x71, 0x79, 0xc0, 0x2d, 0x15, 0x8a, 0xe7, 0x62, 0x75, 0xce, 0x48, 0x4d, - 0xce, 0x16, 0x92, 0xd2, 0x83, 0xda, 0xe8, 0x01, 0xa6, 0xc0, 0x82, 0x41, 0xa9, 0x85, 0xa5, 0xa9, - 0xc5, 0x25, 0x52, 0xd2, 0x58, 0xe5, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x95, 0x64, 0x9b, 0x2e, - 0x3f, 0x99, 0xcc, 0x24, 0x2e, 0x24, 0xaa, 0x5f, 0x66, 0x88, 0xea, 0x57, 0x90, 0x5a, 0x27, 0xdf, - 0x49, 0x8e, 0xc2, 0x42, 0x82, 0xc8, 0x76, 0x1a, 0x31, 0x1b, 0xea, 0x19, 0x44, 0x99, 0xa6, 0x67, - 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x57, 0xe6, 0x97, 0x16, 0x15, 0xa5, 0x16, - 0x40, 0x83, 0x4a, 0x17, 0xac, 0x4a, 0x37, 0x33, 0x25, 0x47, 0x3f, 0x3d, 0x35, 0x4f, 0x3f, 0x1d, - 0x39, 0x04, 0x93, 0xd8, 0xc0, 0x9e, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x7a, 0x4e, - 0x9a, 0x5c, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// HelloworldClient is the client API for Helloworld service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type HelloworldClient interface { - Check(ctx context.Context, in *health.HealthCheckRequest, opts ...grpc.CallOption) (*health.HealthCheckResponse, error) -} - -type helloworldClient struct { - cc *grpc.ClientConn -} - -func NewHelloworldClient(cc *grpc.ClientConn) HelloworldClient { - return &helloworldClient{cc} -} - -func (c *helloworldClient) Check(ctx context.Context, in *health.HealthCheckRequest, opts ...grpc.CallOption) (*health.HealthCheckResponse, error) { - out := new(health.HealthCheckResponse) - err := c.cc.Invoke(ctx, "/helloworld.Helloworld/Check", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HelloworldServer is the server API for Helloworld service. -type HelloworldServer interface { - Check(context.Context, *health.HealthCheckRequest) (*health.HealthCheckResponse, error) -} - -// UnimplementedHelloworldServer can be embedded to have forward compatible implementations. -type UnimplementedHelloworldServer struct { -} - -func (*UnimplementedHelloworldServer) Check(ctx context.Context, req *health.HealthCheckRequest) (*health.HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") -} - -func RegisterHelloworldServer(s *grpc.Server, srv HelloworldServer) { - s.RegisterService(&_Helloworld_serviceDesc, srv) -} - -func _Helloworld_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(health.HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HelloworldServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/helloworld.Helloworld/Check", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HelloworldServer).Check(ctx, req.(*health.HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Helloworld_serviceDesc = grpc.ServiceDesc{ - ServiceName: "helloworld.Helloworld", - HandlerType: (*HelloworldServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Helloworld_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto/helloworld/helloworld.proto", -} diff --git a/example/hello-world/hello-world-idl/gen/web/health/health_pb.d.ts b/example/hello-world/hello-world-idl/gen/web/health/health_pb.d.ts deleted file mode 100644 index 015e32a18..000000000 --- a/example/hello-world/hello-world-idl/gen/web/health/health_pb.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as jspb from "google-protobuf" - -import * as google_api_annotations_pb from '../../google/api/annotations_pb'; -import * as protoc$gen$swagger_options_annotations_pb from '../../protoc-gen-swagger/options/annotations_pb'; - -export class HealthCheckRequest extends jspb.Message { - getService(): string; - setService(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HealthCheckRequest.AsObject; - static toObject(includeInstance: boolean, msg: HealthCheckRequest): HealthCheckRequest.AsObject; - static serializeBinaryToWriter(message: HealthCheckRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HealthCheckRequest; - static deserializeBinaryFromReader(message: HealthCheckRequest, reader: jspb.BinaryReader): HealthCheckRequest; -} - -export namespace HealthCheckRequest { - export type AsObject = { - service: string, - } -} - -export class HealthCheckResponse extends jspb.Message { - getStatus(): HealthCheckResponse.ServingStatus; - setStatus(value: HealthCheckResponse.ServingStatus): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HealthCheckResponse.AsObject; - static toObject(includeInstance: boolean, msg: HealthCheckResponse): HealthCheckResponse.AsObject; - static serializeBinaryToWriter(message: HealthCheckResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HealthCheckResponse; - static deserializeBinaryFromReader(message: HealthCheckResponse, reader: jspb.BinaryReader): HealthCheckResponse; -} - -export namespace HealthCheckResponse { - export type AsObject = { - status: HealthCheckResponse.ServingStatus, - } - - export enum ServingStatus { - UNKNOWN = 0, - SERVING = 1, - NOT_SERVING = 2, - SERVICE_UNKNOWN = 3, - } -} - diff --git a/example/hello-world/hello-world-idl/gen/web/helloworld/helloworld_pb.d.ts b/example/hello-world/hello-world-idl/gen/web/helloworld/helloworld_pb.d.ts deleted file mode 100644 index 9e09300a8..000000000 --- a/example/hello-world/hello-world-idl/gen/web/helloworld/helloworld_pb.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as jspb from "google-protobuf" - -import * as proto_health_health_pb from '../../proto/health/health_pb'; -import * as google_api_annotations_pb from '../../google/api/annotations_pb'; -import * as protoc$gen$swagger_options_annotations_pb from '../../protoc-gen-swagger/options/annotations_pb'; - diff --git a/example/hello-world/hello-world-idl/go.mod b/example/hello-world/hello-world-idl/go.mod deleted file mode 100644 index 208e33ba3..000000000 --- a/example/hello-world/hello-world-idl/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/yourrepo/hello-world-idl - -go 1.12 diff --git a/example/hello-world/hello-world-idl/proto/health/health.proto b/example/hello-world/hello-world-idl/proto/health/health.proto deleted file mode 100644 index 816499b42..000000000 --- a/example/hello-world/hello-world-idl/proto/health/health.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/yourrepo/hello-world-idl/gen/go/health"; - -package health; -import "google/api/annotations.proto"; -import "protoc-gen-swagger/options/annotations.proto"; - -option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { - info: { - title: "Health Checks"; - version: "1.0"; - } -}; - -message HealthCheckRequest { - string service = 1; -} - -message HealthCheckResponse { - enum ServingStatus { - UNKNOWN = 0; - SERVING = 1; - NOT_SERVING = 2; - SERVICE_UNKNOWN = 3; - } - ServingStatus status = 1; -} - -service Health { - rpc Check(HealthCheckRequest) returns (HealthCheckResponse){ - option (google.api.http) = { - get: "/v1/health" - }; - } - - rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse); -} diff --git a/example/hello-world/hello-world-idl/proto/helloworld/helloworld.proto b/example/hello-world/hello-world-idl/proto/helloworld/helloworld.proto deleted file mode 100644 index ce1ce7645..000000000 --- a/example/hello-world/hello-world-idl/proto/helloworld/helloworld.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/yourrepo/hello-world-idl/gen/go/helloworld"; - -package helloworld; - -import "proto/health/health.proto"; -import "google/api/annotations.proto"; -import "protoc-gen-swagger/options/annotations.proto"; - -option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { - info: { - title: "Helloworld"; - version: "1.0"; - } -}; - -service Helloworld { - rpc Check(health.HealthCheckRequest) returns (health.HealthCheckResponse){ - option (google.api.http) = { - get: "/v1/helloworld/health" - }; - } -} diff --git a/example/hello-world/main.go b/example/hello-world/main.go deleted file mode 100644 index 942274b8d..000000000 --- a/example/hello-world/main.go +++ /dev/null @@ -1,36 +0,0 @@ -package main -import ( - "log" - "net" - - healthpb "github.com/yourrepo/hello-world-idl/gen/go/health" - helloworldpb "github.com/yourrepo/hello-world-idl/gen/go/helloworld" - - health "github.com/yourrepo/hello-world/server/health" - helloworld "github.com/yourrepo/hello-world/server/helloworld" - - "google.golang.org/grpc" -) - -func main() { - grpcAddr := "0.0.0.0:3000" - lis, err := net.Listen("tcp", grpcAddr) - if err != nil { - log.Fatalf("failed to listen: %v", err) - } - - s := grpc.NewServer() - - //Server initialization & registration - healthServer := health.NewHealthServer() - healthpb.RegisterHealthServer(s, healthServer) - helloworldServer := helloworld.NewHelloworldServer() - helloworldpb.RegisterHelloworldServer(s, helloworldServer) - - - log.Printf("Starting grpc server on %v...", grpcAddr) - - if err := s.Serve(lis); err != nil { - log.Fatalf("failed to serve: %v", err) - } -} diff --git a/example/hello-world/server/health/health.go b/example/hello-world/server/health/health.go deleted file mode 100644 index cd276d311..000000000 --- a/example/hello-world/server/health/health.go +++ /dev/null @@ -1,25 +0,0 @@ -package health - -import ( - "context" - api "github.com/yourrepo/hello-world-idl/gen/go/health" -) - -type HealthServer struct { - -} - -func NewHealthServer() *HealthServer { - return &HealthServer{} -} - -func (s *HealthServer) Check(ctx context.Context, req *api.HealthCheckRequest) (*api.HealthCheckResponse, error) { - resp := &api.HealthCheckResponse{ - Status: api.HealthCheckResponse_SERVING, - } - return resp,nil -} - -func (s *HealthServer) Watch(req *api.HealthCheckRequest, server api.Health_WatchServer) error { - return nil -} diff --git a/example/hello-world/server/helloworld/helloworld.go b/example/hello-world/server/helloworld/helloworld.go deleted file mode 100644 index f8cded13b..000000000 --- a/example/hello-world/server/helloworld/helloworld.go +++ /dev/null @@ -1,22 +0,0 @@ -package helloworld - -import ( - "context" - health_api "github.com/yourrepo/hello-world-idl/gen/go/health" - //api "github.com/yourrepo/hello-world-idl/gen/go/helloworld" -) - -type HelloworldServer struct { - -} - -func NewHelloworldServer() *HelloworldServer { - return &HelloworldServer{} -} - -func (s *HelloworldServer) Check(ctx context.Context, req *health_api.HealthCheckRequest) (*health_api.HealthCheckResponse, error) { - resp := &health_api.HealthCheckResponse{ - Status: health_api.HealthCheckResponse_SERVING, - } - return resp,nil -} diff --git a/example/hello-world/sprout.yml b/example/hello-world/sprout.yml deleted file mode 100644 index 8192e2d54..000000000 --- a/example/hello-world/sprout.yml +++ /dev/null @@ -1,24 +0,0 @@ -organization: mycompany -name: hello-world -description: -git-repo: github.com/yourrepo -docker-repo: -maintainers: -# - name: bob -# email: bob@test.com - -network: - grpc: - host: 0.0.0.0 - port: 3000 - http: - enabled: true - port: 8080 - web: - enabled: true - port: 8090 - - -services: - - name: helloworld - description: Hello world!.