Debian Codegraph @

examples/v2/foo_grpc.pb.go

raw symbols SCIP
1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
3 package v2
4
5 import (
6 context "context"
7 grpc "google.golang.org/grpc"
8 codes "google.golang.org/grpc/codes"
9 status "google.golang.org/grpc/status"
10 emptypb "google.golang.org/protobuf/types/known/emptypb"
11 )
12
13 // This is a compile-time assertion to ensure that this generated file
14 // is compatible with the grpc package it is being compiled against.
15 // Requires gRPC-Go v1.32.0 or later.
16 const _ = grpc.SupportPackageIsVersion7
17
18 // FooClient is the client API for Foo service.
19 //
20 // 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.
21 type FooClient interface {
22 Do(ctx context.Context, in *DoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
23 }
24
25 type fooClient struct {
26 cc grpc.ClientConnInterface
27 }
28
29 func NewFooClient(cc grpc.ClientConnInterface) FooClient {
30 return &fooClient{cc}
31 }
32
33 func (c *fooClient) Do(ctx context.Context, in *DoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
34 out := new(emptypb.Empty)
35 err := c.cc.Invoke(ctx, "/protobuild.example.v2.Foo/Do", in, out, opts...)
36 if err != nil {
37 return nil, err
38 }
39 return out, nil
40 }
41
42 // FooServer is the server API for Foo service.
43 // All implementations must embed UnimplementedFooServer
44 // for forward compatibility
45 type FooServer interface {
46 Do(context.Context, *DoRequest) (*emptypb.Empty, error)
47 mustEmbedUnimplementedFooServer()
48 }
49
50 // UnimplementedFooServer must be embedded to have forward compatible implementations.
51 type UnimplementedFooServer struct {
52 }
53
54 func (UnimplementedFooServer) Do(context.Context, *DoRequest) (*emptypb.Empty, error) {
55 return nil, status.Errorf(codes.Unimplemented, "method Do not implemented")
56 }
57 func (UnimplementedFooServer) mustEmbedUnimplementedFooServer() {}
58
59 // UnsafeFooServer may be embedded to opt out of forward compatibility for this service.
60 // Use of this interface is not recommended, as added methods to FooServer will
61 // result in compilation errors.
62 type UnsafeFooServer interface {
63 mustEmbedUnimplementedFooServer()
64 }
65
66 func RegisterFooServer(s grpc.ServiceRegistrar, srv FooServer) {
67 s.RegisterService(&Foo_ServiceDesc, srv)
68 }
69
70 func _Foo_Do_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
71 in := new(DoRequest)
72 if err := dec(in); err != nil {
73 return nil, err
74 }
75 if interceptor == nil {
76 return srv.(FooServer).Do(ctx, in)
77 }
78 info := &grpc.UnaryServerInfo{
79 Server: srv,
80 FullMethod: "/protobuild.example.v2.Foo/Do",
81 }
82 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
83 return srv.(FooServer).Do(ctx, req.(*DoRequest))
84 }
85 return interceptor(ctx, in, info, handler)
86 }
87
88 // Foo_ServiceDesc is the grpc.ServiceDesc for Foo service.
89 // It's only intended for direct use with grpc.RegisterService,
90 // and not to be introspected or modified (even as a copy)
91 var Foo_ServiceDesc = grpc.ServiceDesc{
92 ServiceName: "protobuild.example.v2.Foo",
93 HandlerType: (*FooServer)(nil),
94 Methods: []grpc.MethodDesc{
95 {
96 MethodName: "Do",
97 Handler: _Foo_Do_Handler,
98 },
99 },
100 Streams: []grpc.StreamDesc{},
101 Metadata: "github.com/containerd/protobuild/examples/v2/foo.proto",
102 }