// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.30.0--rc2
// source: protos/source/agent.proto

package proto

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AgentService_CreateSite_FullMethodName    = "/agent.AgentService/CreateSite"
	AgentService_UpdateSite_FullMethodName    = "/agent.AgentService/UpdateSite"
	AgentService_DeleteSite_FullMethodName    = "/agent.AgentService/DeleteSite"
	AgentService_UploadRelease_FullMethodName = "/agent.AgentService/UploadRelease"
)

// AgentServiceClient is the client API for AgentService 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 AgentServiceClient interface {
	// 创建站点
	CreateSite(ctx context.Context, in *CreateSiteRequest, opts ...grpc.CallOption) (*CreateSiteResponse, error)
	// 更新站点信息
	UpdateSite(ctx context.Context, in *UpdateSiteRequest, opts ...grpc.CallOption) (*UpdateSiteResponse, error)
	// 删除站点
	DeleteSite(ctx context.Context, in *DeleteSiteRequest, opts ...grpc.CallOption) (*DeleteSiteResponse, error)
	// 上传文件
	UploadRelease(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadReleaseRequest, UploadReleaseResponse], error)
}

type agentServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient {
	return &agentServiceClient{cc}
}

func (c *agentServiceClient) CreateSite(ctx context.Context, in *CreateSiteRequest, opts ...grpc.CallOption) (*CreateSiteResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateSiteResponse)
	err := c.cc.Invoke(ctx, AgentService_CreateSite_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *agentServiceClient) UpdateSite(ctx context.Context, in *UpdateSiteRequest, opts ...grpc.CallOption) (*UpdateSiteResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UpdateSiteResponse)
	err := c.cc.Invoke(ctx, AgentService_UpdateSite_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *agentServiceClient) DeleteSite(ctx context.Context, in *DeleteSiteRequest, opts ...grpc.CallOption) (*DeleteSiteResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteSiteResponse)
	err := c.cc.Invoke(ctx, AgentService_DeleteSite_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *agentServiceClient) UploadRelease(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadReleaseRequest, UploadReleaseResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_UploadRelease_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[UploadReleaseRequest, UploadReleaseResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AgentService_UploadReleaseClient = grpc.ClientStreamingClient[UploadReleaseRequest, UploadReleaseResponse]

// AgentServiceServer is the server API for AgentService service.
// All implementations must embed UnimplementedAgentServiceServer
// for forward compatibility.
//
// 定义服务
type AgentServiceServer interface {
	// 创建站点
	CreateSite(context.Context, *CreateSiteRequest) (*CreateSiteResponse, error)
	// 更新站点信息
	UpdateSite(context.Context, *UpdateSiteRequest) (*UpdateSiteResponse, error)
	// 删除站点
	DeleteSite(context.Context, *DeleteSiteRequest) (*DeleteSiteResponse, error)
	// 上传文件
	UploadRelease(grpc.ClientStreamingServer[UploadReleaseRequest, UploadReleaseResponse]) error
	mustEmbedUnimplementedAgentServiceServer()
}

// UnimplementedAgentServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAgentServiceServer struct{}

func (UnimplementedAgentServiceServer) CreateSite(context.Context, *CreateSiteRequest) (*CreateSiteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateSite not implemented")
}
func (UnimplementedAgentServiceServer) UpdateSite(context.Context, *UpdateSiteRequest) (*UpdateSiteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateSite not implemented")
}
func (UnimplementedAgentServiceServer) DeleteSite(context.Context, *DeleteSiteRequest) (*DeleteSiteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteSite not implemented")
}
func (UnimplementedAgentServiceServer) UploadRelease(grpc.ClientStreamingServer[UploadReleaseRequest, UploadReleaseResponse]) error {
	return status.Errorf(codes.Unimplemented, "method UploadRelease not implemented")
}
func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {}
func (UnimplementedAgentServiceServer) testEmbeddedByValue()                      {}

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

func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) {
	// If the following call pancis, it indicates UnimplementedAgentServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AgentService_ServiceDesc, srv)
}

func _AgentService_CreateSite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateSiteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentServiceServer).CreateSite(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AgentService_CreateSite_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentServiceServer).CreateSite(ctx, req.(*CreateSiteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AgentService_UpdateSite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateSiteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentServiceServer).UpdateSite(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AgentService_UpdateSite_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentServiceServer).UpdateSite(ctx, req.(*UpdateSiteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AgentService_DeleteSite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteSiteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentServiceServer).DeleteSite(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AgentService_DeleteSite_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentServiceServer).DeleteSite(ctx, req.(*DeleteSiteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AgentService_UploadRelease_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AgentServiceServer).UploadRelease(&grpc.GenericServerStream[UploadReleaseRequest, UploadReleaseResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AgentService_UploadReleaseServer = grpc.ClientStreamingServer[UploadReleaseRequest, UploadReleaseResponse]

// AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.AgentService",
	HandlerType: (*AgentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSite",
			Handler:    _AgentService_CreateSite_Handler,
		},
		{
			MethodName: "UpdateSite",
			Handler:    _AgentService_UpdateSite_Handler,
		},
		{
			MethodName: "DeleteSite",
			Handler:    _AgentService_DeleteSite_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "UploadRelease",
			Handler:       _AgentService_UploadRelease_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "protos/source/agent.proto",
}
