gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/grpc/profiling/proto/service_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc v3.14.0 5 // source: profiling/proto/service.proto 6 7 package proto 8 9 import ( 10 context "context" 11 grpc "gitee.com/ks-custle/core-gm/grpc" 12 codes "gitee.com/ks-custle/core-gm/grpc/codes" 13 status "gitee.com/ks-custle/core-gm/grpc/status" 14 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the grpc package it is being compiled against. 18 // Requires gRPC-Go v1.32.0 or later. 19 const _ = grpc.SupportPackageIsVersion7 20 21 // ProfilingClient is the client API for Profiling service. 22 // 23 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 type ProfilingClient interface { 25 // Enable allows users to toggle profiling on and off remotely. 26 Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) 27 // GetStreamStats is used to retrieve an array of stream-level stats from a 28 // gRPC client/server. 29 GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) 30 } 31 32 type profilingClient struct { 33 cc grpc.ClientConnInterface 34 } 35 36 func NewProfilingClient(cc grpc.ClientConnInterface) ProfilingClient { 37 return &profilingClient{cc} 38 } 39 40 func (c *profilingClient) Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) { 41 out := new(EnableResponse) 42 err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/Enable", in, out, opts...) 43 if err != nil { 44 return nil, err 45 } 46 return out, nil 47 } 48 49 func (c *profilingClient) GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) { 50 out := new(GetStreamStatsResponse) 51 err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats", in, out, opts...) 52 if err != nil { 53 return nil, err 54 } 55 return out, nil 56 } 57 58 // ProfilingServer is the server API for Profiling service. 59 // All implementations should embed UnimplementedProfilingServer 60 // for forward compatibility 61 type ProfilingServer interface { 62 // Enable allows users to toggle profiling on and off remotely. 63 Enable(context.Context, *EnableRequest) (*EnableResponse, error) 64 // GetStreamStats is used to retrieve an array of stream-level stats from a 65 // gRPC client/server. 66 GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error) 67 } 68 69 // UnimplementedProfilingServer should be embedded to have forward compatible implementations. 70 type UnimplementedProfilingServer struct { 71 } 72 73 func (UnimplementedProfilingServer) Enable(context.Context, *EnableRequest) (*EnableResponse, error) { 74 return nil, status.Errorf(codes.Unimplemented, "method Enable not implemented") 75 } 76 func (UnimplementedProfilingServer) GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error) { 77 return nil, status.Errorf(codes.Unimplemented, "method GetStreamStats not implemented") 78 } 79 80 // UnsafeProfilingServer may be embedded to opt out of forward compatibility for this service. 81 // Use of this interface is not recommended, as added methods to ProfilingServer will 82 // result in compilation errors. 83 type UnsafeProfilingServer interface { 84 mustEmbedUnimplementedProfilingServer() 85 } 86 87 func RegisterProfilingServer(s grpc.ServiceRegistrar, srv ProfilingServer) { 88 s.RegisterService(&Profiling_ServiceDesc, srv) 89 } 90 91 func _Profiling_Enable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 92 in := new(EnableRequest) 93 if err := dec(in); err != nil { 94 return nil, err 95 } 96 if interceptor == nil { 97 return srv.(ProfilingServer).Enable(ctx, in) 98 } 99 info := &grpc.UnaryServerInfo{ 100 Server: srv, 101 FullMethod: "/grpc.go.profiling.v1alpha.Profiling/Enable", 102 } 103 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 104 return srv.(ProfilingServer).Enable(ctx, req.(*EnableRequest)) 105 } 106 return interceptor(ctx, in, info, handler) 107 } 108 109 func _Profiling_GetStreamStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 110 in := new(GetStreamStatsRequest) 111 if err := dec(in); err != nil { 112 return nil, err 113 } 114 if interceptor == nil { 115 return srv.(ProfilingServer).GetStreamStats(ctx, in) 116 } 117 info := &grpc.UnaryServerInfo{ 118 Server: srv, 119 FullMethod: "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats", 120 } 121 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 122 return srv.(ProfilingServer).GetStreamStats(ctx, req.(*GetStreamStatsRequest)) 123 } 124 return interceptor(ctx, in, info, handler) 125 } 126 127 // Profiling_ServiceDesc is the grpc.ServiceDesc for Profiling service. 128 // It's only intended for direct use with grpc.RegisterService, 129 // and not to be introspected or modified (even as a copy) 130 var Profiling_ServiceDesc = grpc.ServiceDesc{ 131 ServiceName: "grpc.go.profiling.v1alpha.Profiling", 132 HandlerType: (*ProfilingServer)(nil), 133 Methods: []grpc.MethodDesc{ 134 { 135 MethodName: "Enable", 136 Handler: _Profiling_Enable_Handler, 137 }, 138 { 139 MethodName: "GetStreamStats", 140 Handler: _Profiling_GetStreamStats_Handler, 141 }, 142 }, 143 Streams: []grpc.StreamDesc{}, 144 Metadata: "profiling/proto/service.proto", 145 }