...

Source file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb/visibility_rule_echo_service_grpc.pb.go

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             (unknown)
     5  // source: examples/internal/proto/examplepb/visibility_rule_echo_service.proto
     6  
     7  package examplepb
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/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  // VisibilityRuleEchoServiceClient is the client API for VisibilityRuleEchoService 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 VisibilityRuleEchoServiceClient interface {
    25  	// Echo method receives a simple message and returns it.
    26  	// It should always be visible in the open API output.
    27  	Echo(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error)
    28  	// EchoInternal is an internal API that should only be visible in the OpenAPI spec
    29  	// if `visibility_restriction_selectors` includes "INTERNAL".
    30  	EchoInternal(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error)
    31  	// EchoPreview is a preview API that should only be visible in the OpenAPI spec
    32  	// if `visibility_restriction_selectors` includes "PREVIEW".
    33  	EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleMessageInPreviewMethod, error)
    34  	// EchoInternalAndPreview is a internal and preview API that should only be visible in the OpenAPI spec
    35  	// if `visibility_restriction_selectors` includes "PREVIEW" or "INTERNAL".
    36  	EchoInternalAndPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error)
    37  }
    38  
    39  type visibilityRuleEchoServiceClient struct {
    40  	cc grpc.ClientConnInterface
    41  }
    42  
    43  func NewVisibilityRuleEchoServiceClient(cc grpc.ClientConnInterface) VisibilityRuleEchoServiceClient {
    44  	return &visibilityRuleEchoServiceClient{cc}
    45  }
    46  
    47  func (c *visibilityRuleEchoServiceClient) Echo(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) {
    48  	out := new(VisibilityRuleSimpleMessage)
    49  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/Echo", in, out, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return out, nil
    54  }
    55  
    56  func (c *visibilityRuleEchoServiceClient) EchoInternal(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) {
    57  	out := new(VisibilityRuleSimpleMessage)
    58  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoInternal", in, out, opts...)
    59  	if err != nil {
    60  		return nil, err
    61  	}
    62  	return out, nil
    63  }
    64  
    65  func (c *visibilityRuleEchoServiceClient) EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleMessageInPreviewMethod, error) {
    66  	out := new(VisibilityRuleMessageInPreviewMethod)
    67  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoPreview", in, out, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return out, nil
    72  }
    73  
    74  func (c *visibilityRuleEchoServiceClient) EchoInternalAndPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) {
    75  	out := new(VisibilityRuleSimpleMessage)
    76  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoInternalAndPreview", in, out, opts...)
    77  	if err != nil {
    78  		return nil, err
    79  	}
    80  	return out, nil
    81  }
    82  
    83  // VisibilityRuleEchoServiceServer is the server API for VisibilityRuleEchoService service.
    84  // All implementations should embed UnimplementedVisibilityRuleEchoServiceServer
    85  // for forward compatibility
    86  type VisibilityRuleEchoServiceServer interface {
    87  	// Echo method receives a simple message and returns it.
    88  	// It should always be visible in the open API output.
    89  	Echo(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error)
    90  	// EchoInternal is an internal API that should only be visible in the OpenAPI spec
    91  	// if `visibility_restriction_selectors` includes "INTERNAL".
    92  	EchoInternal(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error)
    93  	// EchoPreview is a preview API that should only be visible in the OpenAPI spec
    94  	// if `visibility_restriction_selectors` includes "PREVIEW".
    95  	EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleMessageInPreviewMethod, error)
    96  	// EchoInternalAndPreview is a internal and preview API that should only be visible in the OpenAPI spec
    97  	// if `visibility_restriction_selectors` includes "PREVIEW" or "INTERNAL".
    98  	EchoInternalAndPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error)
    99  }
   100  
   101  // UnimplementedVisibilityRuleEchoServiceServer should be embedded to have forward compatible implementations.
   102  type UnimplementedVisibilityRuleEchoServiceServer struct {
   103  }
   104  
   105  func (UnimplementedVisibilityRuleEchoServiceServer) Echo(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) {
   106  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
   107  }
   108  func (UnimplementedVisibilityRuleEchoServiceServer) EchoInternal(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) {
   109  	return nil, status.Errorf(codes.Unimplemented, "method EchoInternal not implemented")
   110  }
   111  func (UnimplementedVisibilityRuleEchoServiceServer) EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleMessageInPreviewMethod, error) {
   112  	return nil, status.Errorf(codes.Unimplemented, "method EchoPreview not implemented")
   113  }
   114  func (UnimplementedVisibilityRuleEchoServiceServer) EchoInternalAndPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) {
   115  	return nil, status.Errorf(codes.Unimplemented, "method EchoInternalAndPreview not implemented")
   116  }
   117  
   118  // UnsafeVisibilityRuleEchoServiceServer may be embedded to opt out of forward compatibility for this service.
   119  // Use of this interface is not recommended, as added methods to VisibilityRuleEchoServiceServer will
   120  // result in compilation errors.
   121  type UnsafeVisibilityRuleEchoServiceServer interface {
   122  	mustEmbedUnimplementedVisibilityRuleEchoServiceServer()
   123  }
   124  
   125  func RegisterVisibilityRuleEchoServiceServer(s grpc.ServiceRegistrar, srv VisibilityRuleEchoServiceServer) {
   126  	s.RegisterService(&VisibilityRuleEchoService_ServiceDesc, srv)
   127  }
   128  
   129  func _VisibilityRuleEchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   130  	in := new(VisibilityRuleSimpleMessage)
   131  	if err := dec(in); err != nil {
   132  		return nil, err
   133  	}
   134  	if interceptor == nil {
   135  		return srv.(VisibilityRuleEchoServiceServer).Echo(ctx, in)
   136  	}
   137  	info := &grpc.UnaryServerInfo{
   138  		Server:     srv,
   139  		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/Echo",
   140  	}
   141  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   142  		return srv.(VisibilityRuleEchoServiceServer).Echo(ctx, req.(*VisibilityRuleSimpleMessage))
   143  	}
   144  	return interceptor(ctx, in, info, handler)
   145  }
   146  
   147  func _VisibilityRuleEchoService_EchoInternal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   148  	in := new(VisibilityRuleSimpleMessage)
   149  	if err := dec(in); err != nil {
   150  		return nil, err
   151  	}
   152  	if interceptor == nil {
   153  		return srv.(VisibilityRuleEchoServiceServer).EchoInternal(ctx, in)
   154  	}
   155  	info := &grpc.UnaryServerInfo{
   156  		Server:     srv,
   157  		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoInternal",
   158  	}
   159  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   160  		return srv.(VisibilityRuleEchoServiceServer).EchoInternal(ctx, req.(*VisibilityRuleSimpleMessage))
   161  	}
   162  	return interceptor(ctx, in, info, handler)
   163  }
   164  
   165  func _VisibilityRuleEchoService_EchoPreview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   166  	in := new(VisibilityRuleSimpleMessage)
   167  	if err := dec(in); err != nil {
   168  		return nil, err
   169  	}
   170  	if interceptor == nil {
   171  		return srv.(VisibilityRuleEchoServiceServer).EchoPreview(ctx, in)
   172  	}
   173  	info := &grpc.UnaryServerInfo{
   174  		Server:     srv,
   175  		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoPreview",
   176  	}
   177  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   178  		return srv.(VisibilityRuleEchoServiceServer).EchoPreview(ctx, req.(*VisibilityRuleSimpleMessage))
   179  	}
   180  	return interceptor(ctx, in, info, handler)
   181  }
   182  
   183  func _VisibilityRuleEchoService_EchoInternalAndPreview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   184  	in := new(VisibilityRuleSimpleMessage)
   185  	if err := dec(in); err != nil {
   186  		return nil, err
   187  	}
   188  	if interceptor == nil {
   189  		return srv.(VisibilityRuleEchoServiceServer).EchoInternalAndPreview(ctx, in)
   190  	}
   191  	info := &grpc.UnaryServerInfo{
   192  		Server:     srv,
   193  		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoInternalAndPreview",
   194  	}
   195  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   196  		return srv.(VisibilityRuleEchoServiceServer).EchoInternalAndPreview(ctx, req.(*VisibilityRuleSimpleMessage))
   197  	}
   198  	return interceptor(ctx, in, info, handler)
   199  }
   200  
   201  // VisibilityRuleEchoService_ServiceDesc is the grpc.ServiceDesc for VisibilityRuleEchoService service.
   202  // It's only intended for direct use with grpc.RegisterService,
   203  // and not to be introspected or modified (even as a copy)
   204  var VisibilityRuleEchoService_ServiceDesc = grpc.ServiceDesc{
   205  	ServiceName: "grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService",
   206  	HandlerType: (*VisibilityRuleEchoServiceServer)(nil),
   207  	Methods: []grpc.MethodDesc{
   208  		{
   209  			MethodName: "Echo",
   210  			Handler:    _VisibilityRuleEchoService_Echo_Handler,
   211  		},
   212  		{
   213  			MethodName: "EchoInternal",
   214  			Handler:    _VisibilityRuleEchoService_EchoInternal_Handler,
   215  		},
   216  		{
   217  			MethodName: "EchoPreview",
   218  			Handler:    _VisibilityRuleEchoService_EchoPreview_Handler,
   219  		},
   220  		{
   221  			MethodName: "EchoInternalAndPreview",
   222  			Handler:    _VisibilityRuleEchoService_EchoInternalAndPreview_Handler,
   223  		},
   224  	},
   225  	Streams:  []grpc.StreamDesc{},
   226  	Metadata: "examples/internal/proto/examplepb/visibility_rule_echo_service.proto",
   227  }
   228  
   229  // VisibilityRuleInternalEchoServiceClient is the client API for VisibilityRuleInternalEchoService service.
   230  //
   231  // 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.
   232  type VisibilityRuleInternalEchoServiceClient interface {
   233  	// Echo method receives a simple message and returns it.
   234  	// It should not be visible in the open API output.
   235  	Echo(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error)
   236  }
   237  
   238  type visibilityRuleInternalEchoServiceClient struct {
   239  	cc grpc.ClientConnInterface
   240  }
   241  
   242  func NewVisibilityRuleInternalEchoServiceClient(cc grpc.ClientConnInterface) VisibilityRuleInternalEchoServiceClient {
   243  	return &visibilityRuleInternalEchoServiceClient{cc}
   244  }
   245  
   246  func (c *visibilityRuleInternalEchoServiceClient) Echo(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) {
   247  	out := new(VisibilityRuleSimpleMessage)
   248  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService/Echo", in, out, opts...)
   249  	if err != nil {
   250  		return nil, err
   251  	}
   252  	return out, nil
   253  }
   254  
   255  // VisibilityRuleInternalEchoServiceServer is the server API for VisibilityRuleInternalEchoService service.
   256  // All implementations should embed UnimplementedVisibilityRuleInternalEchoServiceServer
   257  // for forward compatibility
   258  type VisibilityRuleInternalEchoServiceServer interface {
   259  	// Echo method receives a simple message and returns it.
   260  	// It should not be visible in the open API output.
   261  	Echo(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error)
   262  }
   263  
   264  // UnimplementedVisibilityRuleInternalEchoServiceServer should be embedded to have forward compatible implementations.
   265  type UnimplementedVisibilityRuleInternalEchoServiceServer struct {
   266  }
   267  
   268  func (UnimplementedVisibilityRuleInternalEchoServiceServer) Echo(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) {
   269  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
   270  }
   271  
   272  // UnsafeVisibilityRuleInternalEchoServiceServer may be embedded to opt out of forward compatibility for this service.
   273  // Use of this interface is not recommended, as added methods to VisibilityRuleInternalEchoServiceServer will
   274  // result in compilation errors.
   275  type UnsafeVisibilityRuleInternalEchoServiceServer interface {
   276  	mustEmbedUnimplementedVisibilityRuleInternalEchoServiceServer()
   277  }
   278  
   279  func RegisterVisibilityRuleInternalEchoServiceServer(s grpc.ServiceRegistrar, srv VisibilityRuleInternalEchoServiceServer) {
   280  	s.RegisterService(&VisibilityRuleInternalEchoService_ServiceDesc, srv)
   281  }
   282  
   283  func _VisibilityRuleInternalEchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   284  	in := new(VisibilityRuleSimpleMessage)
   285  	if err := dec(in); err != nil {
   286  		return nil, err
   287  	}
   288  	if interceptor == nil {
   289  		return srv.(VisibilityRuleInternalEchoServiceServer).Echo(ctx, in)
   290  	}
   291  	info := &grpc.UnaryServerInfo{
   292  		Server:     srv,
   293  		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService/Echo",
   294  	}
   295  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   296  		return srv.(VisibilityRuleInternalEchoServiceServer).Echo(ctx, req.(*VisibilityRuleSimpleMessage))
   297  	}
   298  	return interceptor(ctx, in, info, handler)
   299  }
   300  
   301  // VisibilityRuleInternalEchoService_ServiceDesc is the grpc.ServiceDesc for VisibilityRuleInternalEchoService service.
   302  // It's only intended for direct use with grpc.RegisterService,
   303  // and not to be introspected or modified (even as a copy)
   304  var VisibilityRuleInternalEchoService_ServiceDesc = grpc.ServiceDesc{
   305  	ServiceName: "grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService",
   306  	HandlerType: (*VisibilityRuleInternalEchoServiceServer)(nil),
   307  	Methods: []grpc.MethodDesc{
   308  		{
   309  			MethodName: "Echo",
   310  			Handler:    _VisibilityRuleInternalEchoService_Echo_Handler,
   311  		},
   312  	},
   313  	Streams:  []grpc.StreamDesc{},
   314  	Metadata: "examples/internal/proto/examplepb/visibility_rule_echo_service.proto",
   315  }
   316  

View as plain text