service_grpc.pb.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. // Copyright 2019 gRPC authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  15. // versions:
  16. // - protoc-gen-go-grpc v1.3.0
  17. // - protoc v4.22.0
  18. // source: profiling/proto/service.proto
  19. package proto
  20. import (
  21. context "context"
  22. grpc "google.golang.org/grpc"
  23. codes "google.golang.org/grpc/codes"
  24. status "google.golang.org/grpc/status"
  25. )
  26. // This is a compile-time assertion to ensure that this generated file
  27. // is compatible with the grpc package it is being compiled against.
  28. // Requires gRPC-Go v1.32.0 or later.
  29. const _ = grpc.SupportPackageIsVersion7
  30. const (
  31. Profiling_Enable_FullMethodName = "/grpc.go.profiling.v1alpha.Profiling/Enable"
  32. Profiling_GetStreamStats_FullMethodName = "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats"
  33. )
  34. // ProfilingClient is the client API for Profiling service.
  35. //
  36. // 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.
  37. type ProfilingClient interface {
  38. // Enable allows users to toggle profiling on and off remotely.
  39. Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error)
  40. // GetStreamStats is used to retrieve an array of stream-level stats from a
  41. // gRPC client/server.
  42. GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error)
  43. }
  44. type profilingClient struct {
  45. cc grpc.ClientConnInterface
  46. }
  47. func NewProfilingClient(cc grpc.ClientConnInterface) ProfilingClient {
  48. return &profilingClient{cc}
  49. }
  50. func (c *profilingClient) Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) {
  51. out := new(EnableResponse)
  52. err := c.cc.Invoke(ctx, Profiling_Enable_FullMethodName, in, out, opts...)
  53. if err != nil {
  54. return nil, err
  55. }
  56. return out, nil
  57. }
  58. func (c *profilingClient) GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) {
  59. out := new(GetStreamStatsResponse)
  60. err := c.cc.Invoke(ctx, Profiling_GetStreamStats_FullMethodName, in, out, opts...)
  61. if err != nil {
  62. return nil, err
  63. }
  64. return out, nil
  65. }
  66. // ProfilingServer is the server API for Profiling service.
  67. // All implementations should embed UnimplementedProfilingServer
  68. // for forward compatibility
  69. type ProfilingServer interface {
  70. // Enable allows users to toggle profiling on and off remotely.
  71. Enable(context.Context, *EnableRequest) (*EnableResponse, error)
  72. // GetStreamStats is used to retrieve an array of stream-level stats from a
  73. // gRPC client/server.
  74. GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error)
  75. }
  76. // UnimplementedProfilingServer should be embedded to have forward compatible implementations.
  77. type UnimplementedProfilingServer struct {
  78. }
  79. func (UnimplementedProfilingServer) Enable(context.Context, *EnableRequest) (*EnableResponse, error) {
  80. return nil, status.Errorf(codes.Unimplemented, "method Enable not implemented")
  81. }
  82. func (UnimplementedProfilingServer) GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error) {
  83. return nil, status.Errorf(codes.Unimplemented, "method GetStreamStats not implemented")
  84. }
  85. // UnsafeProfilingServer may be embedded to opt out of forward compatibility for this service.
  86. // Use of this interface is not recommended, as added methods to ProfilingServer will
  87. // result in compilation errors.
  88. type UnsafeProfilingServer interface {
  89. mustEmbedUnimplementedProfilingServer()
  90. }
  91. func RegisterProfilingServer(s grpc.ServiceRegistrar, srv ProfilingServer) {
  92. s.RegisterService(&Profiling_ServiceDesc, srv)
  93. }
  94. func _Profiling_Enable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  95. in := new(EnableRequest)
  96. if err := dec(in); err != nil {
  97. return nil, err
  98. }
  99. if interceptor == nil {
  100. return srv.(ProfilingServer).Enable(ctx, in)
  101. }
  102. info := &grpc.UnaryServerInfo{
  103. Server: srv,
  104. FullMethod: Profiling_Enable_FullMethodName,
  105. }
  106. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  107. return srv.(ProfilingServer).Enable(ctx, req.(*EnableRequest))
  108. }
  109. return interceptor(ctx, in, info, handler)
  110. }
  111. func _Profiling_GetStreamStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  112. in := new(GetStreamStatsRequest)
  113. if err := dec(in); err != nil {
  114. return nil, err
  115. }
  116. if interceptor == nil {
  117. return srv.(ProfilingServer).GetStreamStats(ctx, in)
  118. }
  119. info := &grpc.UnaryServerInfo{
  120. Server: srv,
  121. FullMethod: Profiling_GetStreamStats_FullMethodName,
  122. }
  123. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  124. return srv.(ProfilingServer).GetStreamStats(ctx, req.(*GetStreamStatsRequest))
  125. }
  126. return interceptor(ctx, in, info, handler)
  127. }
  128. // Profiling_ServiceDesc is the grpc.ServiceDesc for Profiling service.
  129. // It's only intended for direct use with grpc.RegisterService,
  130. // and not to be introspected or modified (even as a copy)
  131. var Profiling_ServiceDesc = grpc.ServiceDesc{
  132. ServiceName: "grpc.go.profiling.v1alpha.Profiling",
  133. HandlerType: (*ProfilingServer)(nil),
  134. Methods: []grpc.MethodDesc{
  135. {
  136. MethodName: "Enable",
  137. Handler: _Profiling_Enable_Handler,
  138. },
  139. {
  140. MethodName: "GetStreamStats",
  141. Handler: _Profiling_GetStreamStats_Handler,
  142. },
  143. },
  144. Streams: []grpc.StreamDesc{},
  145. Metadata: "profiling/proto/service.proto",
  146. }