1
2
3
4
5
6
7 package inbound
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
17
18
19 const _ = grpc.SupportPackageIsVersion7
20
21 const (
22 InboundServerPolicies_GetPort_FullMethodName = "/io.linkerd.proxy.inbound.InboundServerPolicies/GetPort"
23 InboundServerPolicies_WatchPort_FullMethodName = "/io.linkerd.proxy.inbound.InboundServerPolicies/WatchPort"
24 )
25
26
27
28
29 type InboundServerPoliciesClient interface {
30
31 GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error)
32
33 WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (InboundServerPolicies_WatchPortClient, error)
34 }
35
36 type inboundServerPoliciesClient struct {
37 cc grpc.ClientConnInterface
38 }
39
40 func NewInboundServerPoliciesClient(cc grpc.ClientConnInterface) InboundServerPoliciesClient {
41 return &inboundServerPoliciesClient{cc}
42 }
43
44 func (c *inboundServerPoliciesClient) GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error) {
45 out := new(Server)
46 err := c.cc.Invoke(ctx, InboundServerPolicies_GetPort_FullMethodName, in, out, opts...)
47 if err != nil {
48 return nil, err
49 }
50 return out, nil
51 }
52
53 func (c *inboundServerPoliciesClient) WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (InboundServerPolicies_WatchPortClient, error) {
54 stream, err := c.cc.NewStream(ctx, &InboundServerPolicies_ServiceDesc.Streams[0], InboundServerPolicies_WatchPort_FullMethodName, opts...)
55 if err != nil {
56 return nil, err
57 }
58 x := &inboundServerPoliciesWatchPortClient{stream}
59 if err := x.ClientStream.SendMsg(in); err != nil {
60 return nil, err
61 }
62 if err := x.ClientStream.CloseSend(); err != nil {
63 return nil, err
64 }
65 return x, nil
66 }
67
68 type InboundServerPolicies_WatchPortClient interface {
69 Recv() (*Server, error)
70 grpc.ClientStream
71 }
72
73 type inboundServerPoliciesWatchPortClient struct {
74 grpc.ClientStream
75 }
76
77 func (x *inboundServerPoliciesWatchPortClient) Recv() (*Server, error) {
78 m := new(Server)
79 if err := x.ClientStream.RecvMsg(m); err != nil {
80 return nil, err
81 }
82 return m, nil
83 }
84
85
86
87
88 type InboundServerPoliciesServer interface {
89
90 GetPort(context.Context, *PortSpec) (*Server, error)
91
92 WatchPort(*PortSpec, InboundServerPolicies_WatchPortServer) error
93 mustEmbedUnimplementedInboundServerPoliciesServer()
94 }
95
96
97 type UnimplementedInboundServerPoliciesServer struct {
98 }
99
100 func (UnimplementedInboundServerPoliciesServer) GetPort(context.Context, *PortSpec) (*Server, error) {
101 return nil, status.Errorf(codes.Unimplemented, "method GetPort not implemented")
102 }
103 func (UnimplementedInboundServerPoliciesServer) WatchPort(*PortSpec, InboundServerPolicies_WatchPortServer) error {
104 return status.Errorf(codes.Unimplemented, "method WatchPort not implemented")
105 }
106 func (UnimplementedInboundServerPoliciesServer) mustEmbedUnimplementedInboundServerPoliciesServer() {}
107
108
109
110
111 type UnsafeInboundServerPoliciesServer interface {
112 mustEmbedUnimplementedInboundServerPoliciesServer()
113 }
114
115 func RegisterInboundServerPoliciesServer(s grpc.ServiceRegistrar, srv InboundServerPoliciesServer) {
116 s.RegisterService(&InboundServerPolicies_ServiceDesc, srv)
117 }
118
119 func _InboundServerPolicies_GetPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
120 in := new(PortSpec)
121 if err := dec(in); err != nil {
122 return nil, err
123 }
124 if interceptor == nil {
125 return srv.(InboundServerPoliciesServer).GetPort(ctx, in)
126 }
127 info := &grpc.UnaryServerInfo{
128 Server: srv,
129 FullMethod: InboundServerPolicies_GetPort_FullMethodName,
130 }
131 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
132 return srv.(InboundServerPoliciesServer).GetPort(ctx, req.(*PortSpec))
133 }
134 return interceptor(ctx, in, info, handler)
135 }
136
137 func _InboundServerPolicies_WatchPort_Handler(srv interface{}, stream grpc.ServerStream) error {
138 m := new(PortSpec)
139 if err := stream.RecvMsg(m); err != nil {
140 return err
141 }
142 return srv.(InboundServerPoliciesServer).WatchPort(m, &inboundServerPoliciesWatchPortServer{stream})
143 }
144
145 type InboundServerPolicies_WatchPortServer interface {
146 Send(*Server) error
147 grpc.ServerStream
148 }
149
150 type inboundServerPoliciesWatchPortServer struct {
151 grpc.ServerStream
152 }
153
154 func (x *inboundServerPoliciesWatchPortServer) Send(m *Server) error {
155 return x.ServerStream.SendMsg(m)
156 }
157
158
159
160
161 var InboundServerPolicies_ServiceDesc = grpc.ServiceDesc{
162 ServiceName: "io.linkerd.proxy.inbound.InboundServerPolicies",
163 HandlerType: (*InboundServerPoliciesServer)(nil),
164 Methods: []grpc.MethodDesc{
165 {
166 MethodName: "GetPort",
167 Handler: _InboundServerPolicies_GetPort_Handler,
168 },
169 },
170 Streams: []grpc.StreamDesc{
171 {
172 StreamName: "WatchPort",
173 Handler: _InboundServerPolicies_WatchPort_Handler,
174 ServerStreams: true,
175 },
176 },
177 Metadata: "inbound.proto",
178 }
179
View as plain text