// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package api

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// LocalAppClient is the client API for LocalApp service.
//
// 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.
type LocalAppClient interface {
	TunnelStatus(ctx context.Context, in *TunnelStatusRequest, opts ...grpc.CallOption) (LocalApp_TunnelStatusClient, error)
}

type localAppClient struct {
	cc grpc.ClientConnInterface
}

func NewLocalAppClient(cc grpc.ClientConnInterface) LocalAppClient {
	return &localAppClient{cc}
}

func (c *localAppClient) TunnelStatus(ctx context.Context, in *TunnelStatusRequest, opts ...grpc.CallOption) (LocalApp_TunnelStatusClient, error) {
	stream, err := c.cc.NewStream(ctx, &LocalApp_ServiceDesc.Streams[0], "/localapp.LocalApp/TunnelStatus", opts...)
	if err != nil {
		return nil, err
	}
	x := &localAppTunnelStatusClient{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 LocalApp_TunnelStatusClient interface {
	Recv() (*TunnelStatusResponse, error)
	grpc.ClientStream
}

type localAppTunnelStatusClient struct {
	grpc.ClientStream
}

func (x *localAppTunnelStatusClient) Recv() (*TunnelStatusResponse, error) {
	m := new(TunnelStatusResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// LocalAppServer is the server API for LocalApp service.
// All implementations must embed UnimplementedLocalAppServer
// for forward compatibility
type LocalAppServer interface {
	TunnelStatus(*TunnelStatusRequest, LocalApp_TunnelStatusServer) error
	mustEmbedUnimplementedLocalAppServer()
}

// UnimplementedLocalAppServer must be embedded to have forward compatible implementations.
type UnimplementedLocalAppServer struct {
}

func (UnimplementedLocalAppServer) TunnelStatus(*TunnelStatusRequest, LocalApp_TunnelStatusServer) error {
	return status.Errorf(codes.Unimplemented, "method TunnelStatus not implemented")
}
func (UnimplementedLocalAppServer) mustEmbedUnimplementedLocalAppServer() {}

// UnsafeLocalAppServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LocalAppServer will
// result in compilation errors.
type UnsafeLocalAppServer interface {
	mustEmbedUnimplementedLocalAppServer()
}

func RegisterLocalAppServer(s grpc.ServiceRegistrar, srv LocalAppServer) {
	s.RegisterService(&LocalApp_ServiceDesc, srv)
}

func _LocalApp_TunnelStatus_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TunnelStatusRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LocalAppServer).TunnelStatus(m, &localAppTunnelStatusServer{stream})
}

type LocalApp_TunnelStatusServer interface {
	Send(*TunnelStatusResponse) error
	grpc.ServerStream
}

type localAppTunnelStatusServer struct {
	grpc.ServerStream
}

func (x *localAppTunnelStatusServer) Send(m *TunnelStatusResponse) error {
	return x.ServerStream.SendMsg(m)
}

// LocalApp_ServiceDesc is the grpc.ServiceDesc for LocalApp service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LocalApp_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "localapp.LocalApp",
	HandlerType: (*LocalAppServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TunnelStatus",
			Handler:       _LocalApp_TunnelStatus_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "localapp.proto",
}
