google.golang.org/grpc@v1.62.1/profiling/proto/service_grpc.pb.go (about)

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