refactor(gRPC): update go proto file
This commit is contained in:
parent
e13a05bc08
commit
8b4424c518
8
Makefile
8
Makefile
|
@ -12,6 +12,9 @@ GOFILES := $(shell find . -name "*.go" -type f)
|
|||
TAGS ?= sqlite
|
||||
LDFLAGS ?= -X 'main.Version=$(VERSION)'
|
||||
|
||||
PROTOC_GEN_GO=v1.28
|
||||
PROTOC_GEN_GO_GRPC=v1.2
|
||||
|
||||
ifneq ($(shell uname), Darwin)
|
||||
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||
else
|
||||
|
@ -163,6 +166,11 @@ clean:
|
|||
find . -name *.db -delete
|
||||
-rm -rf release dist .cover
|
||||
|
||||
.PHONY: proto_install
|
||||
proto_install:
|
||||
$(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO)
|
||||
$(GO) install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GEN_GO_GRPC)
|
||||
|
||||
generate_proto_js:
|
||||
npm install grpc-tools
|
||||
protoc -I rpc/proto rpc/proto/gorush.proto --js_out=import_style=commonjs,binary:rpc/example/node/ --grpc_out=rpc/example/node/ --plugin=protoc-gen-grpc="node_modules/.bin/grpc_tools_node_protoc_plugin"
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.17.3
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.5
|
||||
// source: gorush.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -662,21 +661,18 @@ func file_gorush_proto_rawDescGZIP() []byte {
|
|||
return file_gorush_proto_rawDescData
|
||||
}
|
||||
|
||||
var (
|
||||
file_gorush_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
file_gorush_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
file_gorush_proto_goTypes = []interface{}{
|
||||
(NotificationRequest_Priority)(0), // 0: proto.NotificationRequest.Priority
|
||||
(HealthCheckResponse_ServingStatus)(0), // 1: proto.HealthCheckResponse.ServingStatus
|
||||
(*Alert)(nil), // 2: proto.Alert
|
||||
(*NotificationRequest)(nil), // 3: proto.NotificationRequest
|
||||
(*NotificationReply)(nil), // 4: proto.NotificationReply
|
||||
(*HealthCheckRequest)(nil), // 5: proto.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 6: proto.HealthCheckResponse
|
||||
(*structpb.Struct)(nil), // 7: google.protobuf.Struct
|
||||
}
|
||||
)
|
||||
|
||||
var file_gorush_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_gorush_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_gorush_proto_goTypes = []interface{}{
|
||||
(NotificationRequest_Priority)(0), // 0: proto.NotificationRequest.Priority
|
||||
(HealthCheckResponse_ServingStatus)(0), // 1: proto.HealthCheckResponse.ServingStatus
|
||||
(*Alert)(nil), // 2: proto.Alert
|
||||
(*NotificationRequest)(nil), // 3: proto.NotificationRequest
|
||||
(*NotificationReply)(nil), // 4: proto.NotificationReply
|
||||
(*HealthCheckRequest)(nil), // 5: proto.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 6: proto.HealthCheckResponse
|
||||
(*structpb.Struct)(nil), // 7: google.protobuf.Struct
|
||||
}
|
||||
var file_gorush_proto_depIdxs = []int32{
|
||||
2, // 0: proto.NotificationRequest.alert:type_name -> proto.Alert
|
||||
7, // 1: proto.NotificationRequest.data:type_name -> google.protobuf.Struct
|
||||
|
|
|
@ -2,8 +2,7 @@ syntax = "proto3";
|
|||
import "google/protobuf/struct.proto";
|
||||
|
||||
package proto;
|
||||
|
||||
// option go_package = "./;proto";
|
||||
option go_package = "./;proto";
|
||||
|
||||
message Alert {
|
||||
string title = 1;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.5
|
||||
// source: gorush.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
|
@ -47,7 +50,8 @@ type GorushServer interface {
|
|||
}
|
||||
|
||||
// UnimplementedGorushServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedGorushServer struct{}
|
||||
type UnimplementedGorushServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedGorushServer) Send(context.Context, *NotificationRequest) (*NotificationReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
|
||||
|
@ -130,7 +134,8 @@ type HealthServer interface {
|
|||
}
|
||||
|
||||
// UnimplementedHealthServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedHealthServer struct{}
|
||||
type UnimplementedHealthServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
|
||||
|
|
Loading…
Reference in New Issue