package inbound
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
const _ = grpc.SupportPackageIsVersion9
const (
InboundServerPolicies_GetPort_FullMethodName = "/io.linkerd.proxy.inbound.InboundServerPolicies/GetPort"
InboundServerPolicies_WatchPort_FullMethodName = "/io.linkerd.proxy.inbound.InboundServerPolicies/WatchPort"
)
type InboundServerPoliciesClient interface {
GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error)
WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Server], error)
}
type inboundServerPoliciesClient struct {
cc grpc.ClientConnInterface
}
func NewInboundServerPoliciesClient(cc grpc.ClientConnInterface) InboundServerPoliciesClient {
return &inboundServerPoliciesClient{cc}
}
func (c *inboundServerPoliciesClient) GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Server)
err := c.cc.Invoke(ctx, InboundServerPolicies_GetPort_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *inboundServerPoliciesClient) WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Server], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &InboundServerPolicies_ServiceDesc.Streams[0], InboundServerPolicies_WatchPort_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[PortSpec, Server]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type InboundServerPolicies_WatchPortClient = grpc.ServerStreamingClient[Server]
type InboundServerPoliciesServer interface {
GetPort(context.Context, *PortSpec) (*Server, error)
WatchPort(*PortSpec, grpc.ServerStreamingServer[Server]) error
mustEmbedUnimplementedInboundServerPoliciesServer()
}
type UnimplementedInboundServerPoliciesServer struct{}
func (UnimplementedInboundServerPoliciesServer) GetPort(context.Context, *PortSpec) (*Server, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPort not implemented")
}
func (UnimplementedInboundServerPoliciesServer) WatchPort(*PortSpec, grpc.ServerStreamingServer[Server]) error {
return status.Errorf(codes.Unimplemented, "method WatchPort not implemented")
}
func (UnimplementedInboundServerPoliciesServer) mustEmbedUnimplementedInboundServerPoliciesServer() {}
func (UnimplementedInboundServerPoliciesServer) testEmbeddedByValue() {}
type UnsafeInboundServerPoliciesServer interface {
mustEmbedUnimplementedInboundServerPoliciesServer()
}
func RegisterInboundServerPoliciesServer(s grpc.ServiceRegistrar, srv InboundServerPoliciesServer) {
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&InboundServerPolicies_ServiceDesc, srv)
}
func _InboundServerPolicies_GetPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PortSpec)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(InboundServerPoliciesServer).GetPort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: InboundServerPolicies_GetPort_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InboundServerPoliciesServer).GetPort(ctx, req.(*PortSpec))
}
return interceptor(ctx, in, info, handler)
}
func _InboundServerPolicies_WatchPort_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(PortSpec)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(InboundServerPoliciesServer).WatchPort(m, &grpc.GenericServerStream[PortSpec, Server]{ServerStream: stream})
}
type InboundServerPolicies_WatchPortServer = grpc.ServerStreamingServer[Server]
var InboundServerPolicies_ServiceDesc = grpc.ServiceDesc{
ServiceName: "io.linkerd.proxy.inbound.InboundServerPolicies",
HandlerType: (*InboundServerPoliciesServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetPort",
Handler: _InboundServerPolicies_GetPort_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "WatchPort",
Handler: _InboundServerPolicies_WatchPort_Handler,
ServerStreams: true,
},
},
Metadata: "inbound.proto",
}