Path: blob/main/components/supervisor-api/go/port_grpc.pb.go
2498 views
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-go-grpc. DO NOT EDIT.5// versions:6// - protoc-gen-go-grpc v1.2.07// - protoc v3.20.18// source: port.proto910package api1112import (13context "context"14grpc "google.golang.org/grpc"15codes "google.golang.org/grpc/codes"16status "google.golang.org/grpc/status"17)1819// This is a compile-time assertion to ensure that this generated file20// is compatible with the grpc package it is being compiled against.21// Requires gRPC-Go v1.32.0 or later.22const _ = grpc.SupportPackageIsVersion72324// PortServiceClient is the client API for PortService service.25//26// 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.27type PortServiceClient interface {28// Tunnel notifies clients to install listeners on remote machines.29// After that such clients should call EstablishTunnel to forward incoming connections.30Tunnel(ctx context.Context, in *TunnelPortRequest, opts ...grpc.CallOption) (*TunnelPortResponse, error)31// CloseTunnel notifies clients to remove listeners on remote machines.32CloseTunnel(ctx context.Context, in *CloseTunnelRequest, opts ...grpc.CallOption) (*CloseTunnelResponse, error)33// EstablishTunnel actually establishes the tunnel for an incoming connection on a remote machine.34EstablishTunnel(ctx context.Context, opts ...grpc.CallOption) (PortService_EstablishTunnelClient, error)35// AutoTunnel controls enablement of auto tunneling36AutoTunnel(ctx context.Context, in *AutoTunnelRequest, opts ...grpc.CallOption) (*AutoTunnelResponse, error)37// RetryAutoExpose retries auto exposing the give port38RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error)39}4041type portServiceClient struct {42cc grpc.ClientConnInterface43}4445func NewPortServiceClient(cc grpc.ClientConnInterface) PortServiceClient {46return &portServiceClient{cc}47}4849func (c *portServiceClient) Tunnel(ctx context.Context, in *TunnelPortRequest, opts ...grpc.CallOption) (*TunnelPortResponse, error) {50out := new(TunnelPortResponse)51err := c.cc.Invoke(ctx, "/supervisor.PortService/Tunnel", in, out, opts...)52if err != nil {53return nil, err54}55return out, nil56}5758func (c *portServiceClient) CloseTunnel(ctx context.Context, in *CloseTunnelRequest, opts ...grpc.CallOption) (*CloseTunnelResponse, error) {59out := new(CloseTunnelResponse)60err := c.cc.Invoke(ctx, "/supervisor.PortService/CloseTunnel", in, out, opts...)61if err != nil {62return nil, err63}64return out, nil65}6667func (c *portServiceClient) EstablishTunnel(ctx context.Context, opts ...grpc.CallOption) (PortService_EstablishTunnelClient, error) {68stream, err := c.cc.NewStream(ctx, &PortService_ServiceDesc.Streams[0], "/supervisor.PortService/EstablishTunnel", opts...)69if err != nil {70return nil, err71}72x := &portServiceEstablishTunnelClient{stream}73return x, nil74}7576type PortService_EstablishTunnelClient interface {77Send(*EstablishTunnelRequest) error78Recv() (*EstablishTunnelResponse, error)79grpc.ClientStream80}8182type portServiceEstablishTunnelClient struct {83grpc.ClientStream84}8586func (x *portServiceEstablishTunnelClient) Send(m *EstablishTunnelRequest) error {87return x.ClientStream.SendMsg(m)88}8990func (x *portServiceEstablishTunnelClient) Recv() (*EstablishTunnelResponse, error) {91m := new(EstablishTunnelResponse)92if err := x.ClientStream.RecvMsg(m); err != nil {93return nil, err94}95return m, nil96}9798func (c *portServiceClient) AutoTunnel(ctx context.Context, in *AutoTunnelRequest, opts ...grpc.CallOption) (*AutoTunnelResponse, error) {99out := new(AutoTunnelResponse)100err := c.cc.Invoke(ctx, "/supervisor.PortService/AutoTunnel", in, out, opts...)101if err != nil {102return nil, err103}104return out, nil105}106107func (c *portServiceClient) RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error) {108out := new(RetryAutoExposeResponse)109err := c.cc.Invoke(ctx, "/supervisor.PortService/RetryAutoExpose", in, out, opts...)110if err != nil {111return nil, err112}113return out, nil114}115116// PortServiceServer is the server API for PortService service.117// All implementations must embed UnimplementedPortServiceServer118// for forward compatibility119type PortServiceServer interface {120// Tunnel notifies clients to install listeners on remote machines.121// After that such clients should call EstablishTunnel to forward incoming connections.122Tunnel(context.Context, *TunnelPortRequest) (*TunnelPortResponse, error)123// CloseTunnel notifies clients to remove listeners on remote machines.124CloseTunnel(context.Context, *CloseTunnelRequest) (*CloseTunnelResponse, error)125// EstablishTunnel actually establishes the tunnel for an incoming connection on a remote machine.126EstablishTunnel(PortService_EstablishTunnelServer) error127// AutoTunnel controls enablement of auto tunneling128AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error)129// RetryAutoExpose retries auto exposing the give port130RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error)131mustEmbedUnimplementedPortServiceServer()132}133134// UnimplementedPortServiceServer must be embedded to have forward compatible implementations.135type UnimplementedPortServiceServer struct {136}137138func (UnimplementedPortServiceServer) Tunnel(context.Context, *TunnelPortRequest) (*TunnelPortResponse, error) {139return nil, status.Errorf(codes.Unimplemented, "method Tunnel not implemented")140}141func (UnimplementedPortServiceServer) CloseTunnel(context.Context, *CloseTunnelRequest) (*CloseTunnelResponse, error) {142return nil, status.Errorf(codes.Unimplemented, "method CloseTunnel not implemented")143}144func (UnimplementedPortServiceServer) EstablishTunnel(PortService_EstablishTunnelServer) error {145return status.Errorf(codes.Unimplemented, "method EstablishTunnel not implemented")146}147func (UnimplementedPortServiceServer) AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error) {148return nil, status.Errorf(codes.Unimplemented, "method AutoTunnel not implemented")149}150func (UnimplementedPortServiceServer) RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error) {151return nil, status.Errorf(codes.Unimplemented, "method RetryAutoExpose not implemented")152}153func (UnimplementedPortServiceServer) mustEmbedUnimplementedPortServiceServer() {}154155// UnsafePortServiceServer may be embedded to opt out of forward compatibility for this service.156// Use of this interface is not recommended, as added methods to PortServiceServer will157// result in compilation errors.158type UnsafePortServiceServer interface {159mustEmbedUnimplementedPortServiceServer()160}161162func RegisterPortServiceServer(s grpc.ServiceRegistrar, srv PortServiceServer) {163s.RegisterService(&PortService_ServiceDesc, srv)164}165166func _PortService_Tunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {167in := new(TunnelPortRequest)168if err := dec(in); err != nil {169return nil, err170}171if interceptor == nil {172return srv.(PortServiceServer).Tunnel(ctx, in)173}174info := &grpc.UnaryServerInfo{175Server: srv,176FullMethod: "/supervisor.PortService/Tunnel",177}178handler := func(ctx context.Context, req interface{}) (interface{}, error) {179return srv.(PortServiceServer).Tunnel(ctx, req.(*TunnelPortRequest))180}181return interceptor(ctx, in, info, handler)182}183184func _PortService_CloseTunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {185in := new(CloseTunnelRequest)186if err := dec(in); err != nil {187return nil, err188}189if interceptor == nil {190return srv.(PortServiceServer).CloseTunnel(ctx, in)191}192info := &grpc.UnaryServerInfo{193Server: srv,194FullMethod: "/supervisor.PortService/CloseTunnel",195}196handler := func(ctx context.Context, req interface{}) (interface{}, error) {197return srv.(PortServiceServer).CloseTunnel(ctx, req.(*CloseTunnelRequest))198}199return interceptor(ctx, in, info, handler)200}201202func _PortService_EstablishTunnel_Handler(srv interface{}, stream grpc.ServerStream) error {203return srv.(PortServiceServer).EstablishTunnel(&portServiceEstablishTunnelServer{stream})204}205206type PortService_EstablishTunnelServer interface {207Send(*EstablishTunnelResponse) error208Recv() (*EstablishTunnelRequest, error)209grpc.ServerStream210}211212type portServiceEstablishTunnelServer struct {213grpc.ServerStream214}215216func (x *portServiceEstablishTunnelServer) Send(m *EstablishTunnelResponse) error {217return x.ServerStream.SendMsg(m)218}219220func (x *portServiceEstablishTunnelServer) Recv() (*EstablishTunnelRequest, error) {221m := new(EstablishTunnelRequest)222if err := x.ServerStream.RecvMsg(m); err != nil {223return nil, err224}225return m, nil226}227228func _PortService_AutoTunnel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {229in := new(AutoTunnelRequest)230if err := dec(in); err != nil {231return nil, err232}233if interceptor == nil {234return srv.(PortServiceServer).AutoTunnel(ctx, in)235}236info := &grpc.UnaryServerInfo{237Server: srv,238FullMethod: "/supervisor.PortService/AutoTunnel",239}240handler := func(ctx context.Context, req interface{}) (interface{}, error) {241return srv.(PortServiceServer).AutoTunnel(ctx, req.(*AutoTunnelRequest))242}243return interceptor(ctx, in, info, handler)244}245246func _PortService_RetryAutoExpose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {247in := new(RetryAutoExposeRequest)248if err := dec(in); err != nil {249return nil, err250}251if interceptor == nil {252return srv.(PortServiceServer).RetryAutoExpose(ctx, in)253}254info := &grpc.UnaryServerInfo{255Server: srv,256FullMethod: "/supervisor.PortService/RetryAutoExpose",257}258handler := func(ctx context.Context, req interface{}) (interface{}, error) {259return srv.(PortServiceServer).RetryAutoExpose(ctx, req.(*RetryAutoExposeRequest))260}261return interceptor(ctx, in, info, handler)262}263264// PortService_ServiceDesc is the grpc.ServiceDesc for PortService service.265// It's only intended for direct use with grpc.RegisterService,266// and not to be introspected or modified (even as a copy)267var PortService_ServiceDesc = grpc.ServiceDesc{268ServiceName: "supervisor.PortService",269HandlerType: (*PortServiceServer)(nil),270Methods: []grpc.MethodDesc{271{272MethodName: "Tunnel",273Handler: _PortService_Tunnel_Handler,274},275{276MethodName: "CloseTunnel",277Handler: _PortService_CloseTunnel_Handler,278},279{280MethodName: "AutoTunnel",281Handler: _PortService_AutoTunnel_Handler,282},283{284MethodName: "RetryAutoExpose",285Handler: _PortService_RetryAutoExpose_Handler,286},287},288Streams: []grpc.StreamDesc{289{290StreamName: "EstablishTunnel",291Handler: _PortService_EstablishTunnel_Handler,292ServerStreams: true,293ClientStreams: true,294},295},296Metadata: "port.proto",297}298299300