Browse Source

unsubscribe rename

pull/347/head
Chiwency 4 years ago
parent
commit
4b94f7886d
  1. 2
      admin/src/views/Dashboard/KVPairs/_Components/DialogTopicDetail.vue
  2. 8
      client/dtmgrpc/dtmgpb/dtmgimp.pb.go
  3. 2
      client/dtmgrpc/dtmgpb/dtmgimp.proto
  4. 24
      client/dtmgrpc/dtmgpb/dtmgimp_grpc.pb.go
  5. 2
      dtmsvr/api_grpc.go
  6. 2
      test/topic_test.go

2
admin/src/views/Dashboard/KVPairs/_Components/DialogTopicDetail.vue

@ -5,7 +5,7 @@
<template #bodyCell="{column, record}">
<template v-if="column.key === 'action'">
<span>
<a class="text-red-400 font-medium" @click="handleUnsubscribe(record.url)">UnSubscribe</a>
<a class="text-red-400 font-medium" @click="handleUnsubscribe(record.url)">Unsubscribe</a>
</span>
</template>
</template>

8
client/dtmgrpc/dtmgpb/dtmgimp.pb.go

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.5
// protoc v3.15.6
// source: client/dtmgrpc/dtmgpb/dtmgimp.proto
package dtmgpb
@ -745,7 +745,7 @@ var file_client_dtmgrpc_dtmgpb_dtmgimp_proto_rawDesc = []byte{
0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x54, 0x6f, 0x70, 0x69, 0x63,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x00, 0x12, 0x41, 0x0a, 0x0b, 0x55, 0x6e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
0x00, 0x12, 0x41, 0x0a, 0x0b, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
0x12, 0x18, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x54, 0x6f,
0x70, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
@ -798,7 +798,7 @@ var file_client_dtmgrpc_dtmgpb_dtmgimp_proto_depIdxs = []int32{
3, // 10: dtmgimp.Dtm.RegisterBranch:input_type -> dtmgimp.DtmBranchRequest
1, // 11: dtmgimp.Dtm.PrepareWorkflow:input_type -> dtmgimp.DtmRequest
7, // 12: dtmgimp.Dtm.Subscribe:input_type -> dtmgimp.DtmTopicRequest
7, // 13: dtmgimp.Dtm.UnSubscribe:input_type -> dtmgimp.DtmTopicRequest
7, // 13: dtmgimp.Dtm.Unsubscribe:input_type -> dtmgimp.DtmTopicRequest
7, // 14: dtmgimp.Dtm.DeleteTopic:input_type -> dtmgimp.DtmTopicRequest
2, // 15: dtmgimp.Dtm.NewGid:output_type -> dtmgimp.DtmGidReply
11, // 16: dtmgimp.Dtm.Submit:output_type -> google.protobuf.Empty
@ -807,7 +807,7 @@ var file_client_dtmgrpc_dtmgpb_dtmgimp_proto_depIdxs = []int32{
11, // 19: dtmgimp.Dtm.RegisterBranch:output_type -> google.protobuf.Empty
4, // 20: dtmgimp.Dtm.PrepareWorkflow:output_type -> dtmgimp.DtmProgressesReply
11, // 21: dtmgimp.Dtm.Subscribe:output_type -> google.protobuf.Empty
11, // 22: dtmgimp.Dtm.UnSubscribe:output_type -> google.protobuf.Empty
11, // 22: dtmgimp.Dtm.Unsubscribe:output_type -> google.protobuf.Empty
11, // 23: dtmgimp.Dtm.DeleteTopic:output_type -> google.protobuf.Empty
15, // [15:24] is the sub-list for method output_type
6, // [6:15] is the sub-list for method input_type

2
client/dtmgrpc/dtmgpb/dtmgimp.proto

@ -14,7 +14,7 @@ service Dtm {
rpc RegisterBranch(DtmBranchRequest) returns (google.protobuf.Empty) {}
rpc PrepareWorkflow(DtmRequest) returns (DtmProgressesReply) {}
rpc Subscribe(DtmTopicRequest) returns (google.protobuf.Empty){}
rpc UnSubscribe(DtmTopicRequest) returns (google.protobuf.Empty){}
rpc Unsubscribe(DtmTopicRequest) returns (google.protobuf.Empty){}
rpc DeleteTopic(DtmTopicRequest) returns (google.protobuf.Empty){}
}

24
client/dtmgrpc/dtmgpb/dtmgimp_grpc.pb.go

@ -30,7 +30,7 @@ type DtmClient interface {
RegisterBranch(ctx context.Context, in *DtmBranchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
PrepareWorkflow(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*DtmProgressesReply, error)
Subscribe(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
UnSubscribe(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
Unsubscribe(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
DeleteTopic(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
@ -105,9 +105,9 @@ func (c *dtmClient) Subscribe(ctx context.Context, in *DtmTopicRequest, opts ...
return out, nil
}
func (c *dtmClient) UnSubscribe(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *dtmClient) Unsubscribe(ctx context.Context, in *DtmTopicRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/dtmgimp.Dtm/UnSubscribe", in, out, opts...)
err := c.cc.Invoke(ctx, "/dtmgimp.Dtm/Unsubscribe", in, out, opts...)
if err != nil {
return nil, err
}
@ -134,7 +134,7 @@ type DtmServer interface {
RegisterBranch(context.Context, *DtmBranchRequest) (*emptypb.Empty, error)
PrepareWorkflow(context.Context, *DtmRequest) (*DtmProgressesReply, error)
Subscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error)
UnSubscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error)
Unsubscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error)
DeleteTopic(context.Context, *DtmTopicRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedDtmServer()
}
@ -164,8 +164,8 @@ func (UnimplementedDtmServer) PrepareWorkflow(context.Context, *DtmRequest) (*Dt
func (UnimplementedDtmServer) Subscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedDtmServer) UnSubscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnSubscribe not implemented")
func (UnimplementedDtmServer) Unsubscribe(context.Context, *DtmTopicRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Unsubscribe not implemented")
}
func (UnimplementedDtmServer) DeleteTopic(context.Context, *DtmTopicRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTopic not implemented")
@ -309,20 +309,20 @@ func _Dtm_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler)
}
func _Dtm_UnSubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _Dtm_Unsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DtmTopicRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DtmServer).UnSubscribe(ctx, in)
return srv.(DtmServer).Unsubscribe(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dtmgimp.Dtm/UnSubscribe",
FullMethod: "/dtmgimp.Dtm/Unsubscribe",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DtmServer).UnSubscribe(ctx, req.(*DtmTopicRequest))
return srv.(DtmServer).Unsubscribe(ctx, req.(*DtmTopicRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -381,8 +381,8 @@ var Dtm_ServiceDesc = grpc.ServiceDesc{
Handler: _Dtm_Subscribe_Handler,
},
{
MethodName: "UnSubscribe",
Handler: _Dtm_UnSubscribe_Handler,
MethodName: "Unsubscribe",
Handler: _Dtm_Unsubscribe_Handler,
},
{
MethodName: "DeleteTopic",

2
dtmsvr/api_grpc.go

@ -74,7 +74,7 @@ func (s *dtmServer) Subscribe(ctx context.Context, in *pb.DtmTopicRequest) (*emp
return &emptypb.Empty{}, dtmgrpc.DtmError2GrpcError(Subscribe(in.Topic, in.URL, in.Remark))
}
func (s *dtmServer) UnSubscribe(ctx context.Context, in *pb.DtmTopicRequest) (*emptypb.Empty, error) {
func (s *dtmServer) Unsubscribe(ctx context.Context, in *pb.DtmTopicRequest) (*emptypb.Empty, error) {
return &emptypb.Empty{}, dtmgrpc.DtmError2GrpcError(Unsubscribe(in.Topic, in.URL))
}

2
test/topic_test.go

@ -136,7 +136,7 @@ func grpcSubscribe(topic, url string) error {
}
func grpcUnsubscribe(topic, url string) error {
_, err := dtmgimp.MustGetDtmClient(dtmutil.DefaultGrpcServer).UnSubscribe(context.Background(),
_, err := dtmgimp.MustGetDtmClient(dtmutil.DefaultGrpcServer).Unsubscribe(context.Background(),
&dtmgpb.DtmTopicRequest{
Topic: topic,
URL: url})

Loading…
Cancel
Save