package protoc

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
)

const (

	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)

	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type UploadSteam int32

const (
	UploadSteam_Unknown UploadSteam = 0
	UploadSteam_ok      UploadSteam = 1
	UploadSteam_Failed  UploadSteam = 2
)

var (
	UploadSteam_name = map[int32]string{
		0: "Unknown",
		1: "ok",
		2: "Failed",
	}
	UploadSteam_value = map[string]int32{
		"Unknown": 0,
		"ok":      1,
		"Failed":  2,
	}
)

func (x UploadSteam) Enum() *UploadSteam {
	p := new(UploadSteam)
	*p = x
	return p
}

func (x UploadSteam) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (UploadSteam) Descriptor() protoreflect.EnumDescriptor {
	return file_upload_proto_enumTypes[0].Descriptor()
}

func (UploadSteam) Type() protoreflect.EnumType {
	return &file_upload_proto_enumTypes[0]
}

func (x UploadSteam) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

func (UploadSteam) EnumDescriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{0}
}

type Chinl struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Content []byte `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"`
}

func (x *Chinl) Reset() {
	*x = Chinl{}
	if protoimpl.UnsafeEnabled {
		mi := &file_upload_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *Chinl) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Chinl) ProtoMessage() {}

func (x *Chinl) ProtoReflect() protoreflect.Message {
	mi := &file_upload_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (*Chinl) Descriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{0}
}

func (x *Chinl) GetContent() []byte {
	if x != nil {
		return x.Content
	}
	return nil
}

type UploadStar struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Message string      `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
	Code    UploadSteam `protobuf:"varint,2,opt,name=code,proto3,enum=main.UploadSteam" json:"code,omitempty"`
}

func (x *UploadStar) Reset() {
	*x = UploadStar{}
	if protoimpl.UnsafeEnabled {
		mi := &file_upload_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *UploadStar) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*UploadStar) ProtoMessage() {}

func (x *UploadStar) ProtoReflect() protoreflect.Message {
	mi := &file_upload_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (*UploadStar) Descriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{1}
}

func (x *UploadStar) GetMessage() string {
	if x != nil {
		return x.Message
	}
	return ""
}

func (x *UploadStar) GetCode() UploadSteam {
	if x != nil {
		return x.Code
	}
	return UploadSteam_Unknown
}

var File_upload_proto protoreflect.FileDescriptor

var file_upload_proto_rawDesc = []byte{
	0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04,
	0x6d, 0x61, 0x69, 0x6e, 0x22, 0x21, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6e, 0x6c, 0x12, 0x18, 0x0a,
	0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
	0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x4d, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61,
	0x64, 0x53, 0x74, 0x61, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
	0x25, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e,
	0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x65, 0x61, 0x6d,
	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x2e, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64,
	0x53, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
	0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x6f, 0x6b, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61,
	0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x32, 0x39, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70,
	0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0b,
	0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6e, 0x6c, 0x1a, 0x10, 0x2e, 0x6d, 0x61,
	0x69, 0x6e, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x72, 0x22, 0x00, 0x28,
	0x01, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x62, 0x06, 0x70, 0x72,
	0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_upload_proto_rawDescOnce sync.Once
	file_upload_proto_rawDescData = file_upload_proto_rawDesc
)

func file_upload_proto_rawDescGZIP() []byte {
	file_upload_proto_rawDescOnce.Do(func() {
		file_upload_proto_rawDescData = protoimpl.X.CompressGZIP(file_upload_proto_rawDescData)
	})
	return file_upload_proto_rawDescData
}

var file_upload_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_upload_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_upload_proto_goTypes = []interface{}{
	(UploadSteam)(0),   
	(*Chinl)(nil),      
	(*UploadStar)(nil), 
}
var file_upload_proto_depIdxs = []int32{
	0, 
	1, 
	2, 
	2, 
	1, 
	1, 
	1, 
	0, 
}

func init() { file_upload_proto_init() }
func file_upload_proto_init() {
	if File_upload_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_upload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*Chinl); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_upload_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*UploadStar); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_upload_proto_rawDesc,
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_upload_proto_goTypes,
		DependencyIndexes: file_upload_proto_depIdxs,
		EnumInfos:         file_upload_proto_enumTypes,
		MessageInfos:      file_upload_proto_msgTypes,
	}.Build()
	File_upload_proto = out.File
	file_upload_proto_rawDesc = nil
	file_upload_proto_goTypes = nil
	file_upload_proto_depIdxs = nil
}

var _ context.Context
var _ grpc.ClientConnInterface

const _ = grpc.SupportPackageIsVersion6

type FileUploadClient interface {

	Upload(ctx context.Context, opts ...grpc.CallOption) (FileUpload_UploadClient, error)
}

type fileUploadClient struct {
	cc grpc.ClientConnInterface
}

func NewFileUploadClient(cc grpc.ClientConnInterface) FileUploadClient {
	return &fileUploadClient{cc}
}

func (c *fileUploadClient) Upload(ctx context.Context, opts ...grpc.CallOption) (FileUpload_UploadClient, error) {
	stream, err := c.cc.NewStream(ctx, &_FileUpload_serviceDesc.Streams[0], "/main.FileUpload/upload", opts...)
	if err != nil {
		return nil, err
	}
	x := &fileUploadUploadClient{stream}
	return x, nil
}

type FileUpload_UploadClient interface {
	Send(*Chinl) error
	CloseAndRecv() (*UploadStar, error)
	grpc.ClientStream
}

type fileUploadUploadClient struct {
	grpc.ClientStream
}

func (x *fileUploadUploadClient) Send(m *Chinl) error {
	return x.ClientStream.SendMsg(m)
}

func (x *fileUploadUploadClient) CloseAndRecv() (*UploadStar, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(UploadStar)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

type FileUploadServer interface {

	Upload(FileUpload_UploadServer) error
}

type UnimplementedFileUploadServer struct {
}

func (*UnimplementedFileUploadServer) Upload(FileUpload_UploadServer) error {
	return status.Errorf(codes.Unimplemented, "method Upload not implemented")
}

func RegisterFileUploadServer(s *grpc.Server, srv FileUploadServer) {
	s.RegisterService(&_FileUpload_serviceDesc, srv)
}

func _FileUpload_Upload_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FileUploadServer).Upload(&fileUploadUploadServer{stream})
}

type FileUpload_UploadServer interface {
	SendAndClose(*UploadStar) error
	Recv() (*Chinl, error)
	grpc.ServerStream
}

type fileUploadUploadServer struct {
	grpc.ServerStream
}

func (x *fileUploadUploadServer) SendAndClose(m *UploadStar) error {
	return x.ServerStream.SendMsg(m)
}

func (x *fileUploadUploadServer) Recv() (*Chinl, error) {
	m := new(Chinl)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _FileUpload_serviceDesc = grpc.ServiceDesc{
	ServiceName: "main.FileUpload",
	HandlerType: (*FileUploadServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "upload",
			Handler:       _FileUpload_Upload_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "upload.proto",
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.26.0
// 	protoc        v3.17.3
// source: upload.proto

package protoc

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type UploadSteam int32

const (
	UploadSteam_Unknown UploadSteam = 0
	UploadSteam_ok      UploadSteam = 1
	UploadSteam_Failed  UploadSteam = 2
)

// Enum value maps for UploadSteam.
var (
	UploadSteam_name = map[int32]string{
		0: "Unknown",
		1: "ok",
		2: "Failed",
	}
	UploadSteam_value = map[string]int32{
		"Unknown": 0,
		"ok":      1,
		"Failed":  2,
	}
)

func (x UploadSteam) Enum() *UploadSteam {
	p := new(UploadSteam)
	*p = x
	return p
}

func (x UploadSteam) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (UploadSteam) Descriptor() protoreflect.EnumDescriptor {
	return file_upload_proto_enumTypes[0].Descriptor()
}

func (UploadSteam) Type() protoreflect.EnumType {
	return &file_upload_proto_enumTypes[0]
}

func (x UploadSteam) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use UploadSteam.Descriptor instead.
func (UploadSteam) EnumDescriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{0}
}

//利用bytes用户传输文件，配合grpc的流服务
type Chinl struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Content []byte `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"`
}

func (x *Chinl) Reset() {
	*x = Chinl{}
	if protoimpl.UnsafeEnabled {
		mi := &file_upload_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *Chinl) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Chinl) ProtoMessage() {}

func (x *Chinl) ProtoReflect() protoreflect.Message {
	mi := &file_upload_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Chinl.ProtoReflect.Descriptor instead.
func (*Chinl) Descriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{0}
}

func (x *Chinl) GetContent() []byte {
	if x != nil {
		return x.Content
	}
	return nil
}

type UploadStar struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Message string      `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
	Code    UploadSteam `protobuf:"varint,2,opt,name=code,proto3,enum=main.UploadSteam" json:"code,omitempty"`
}

func (x *UploadStar) Reset() {
	*x = UploadStar{}
	if protoimpl.UnsafeEnabled {
		mi := &file_upload_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *UploadStar) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*UploadStar) ProtoMessage() {}

func (x *UploadStar) ProtoReflect() protoreflect.Message {
	mi := &file_upload_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use UploadStar.ProtoReflect.Descriptor instead.
func (*UploadStar) Descriptor() ([]byte, []int) {
	return file_upload_proto_rawDescGZIP(), []int{1}
}

func (x *UploadStar) GetMessage() string {
	if x != nil {
		return x.Message
	}
	return ""
}

func (x *UploadStar) GetCode() UploadSteam {
	if x != nil {
		return x.Code
	}
	return UploadSteam_Unknown
}

var File_upload_proto protoreflect.FileDescriptor

var file_upload_proto_rawDesc = []byte{
	0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04,
	0x6d, 0x61, 0x69, 0x6e, 0x22, 0x21, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6e, 0x6c, 0x12, 0x18, 0x0a,
	0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
	0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x4d, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61,
	0x64, 0x53, 0x74, 0x61, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
	0x25, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e,
	0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x65, 0x61, 0x6d,
	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0x2e, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64,
	0x53, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
	0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x6f, 0x6b, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61,
	0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x32, 0x39, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70,
	0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0b,
	0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6e, 0x6c, 0x1a, 0x10, 0x2e, 0x6d, 0x61,
	0x69, 0x6e, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x72, 0x22, 0x00, 0x28,
	0x01, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x62, 0x06, 0x70, 0x72,
	0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_upload_proto_rawDescOnce sync.Once
	file_upload_proto_rawDescData = file_upload_proto_rawDesc
)

func file_upload_proto_rawDescGZIP() []byte {
	file_upload_proto_rawDescOnce.Do(func() {
		file_upload_proto_rawDescData = protoimpl.X.CompressGZIP(file_upload_proto_rawDescData)
	})
	return file_upload_proto_rawDescData
}

var file_upload_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_upload_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_upload_proto_goTypes = []interface{}{
	(UploadSteam)(0),   // 0: main.UploadSteam
	(*Chinl)(nil),      // 1: main.Chinl
	(*UploadStar)(nil), // 2: main.UploadStar
}
var file_upload_proto_depIdxs = []int32{
	0, // 0: main.UploadStar.code:type_name -> main.UploadSteam
	1, // 1: main.FileUpload.upload:input_type -> main.Chinl
	2, // 2: main.FileUpload.upload:output_type -> main.UploadStar
	2, // [2:3] is the sub-list for method output_type
	1, // [1:2] is the sub-list for method input_type
	1, // [1:1] is the sub-list for extension type_name
	1, // [1:1] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_upload_proto_init() }
func file_upload_proto_init() {
	if File_upload_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_upload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*Chinl); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_upload_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*UploadStar); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_upload_proto_rawDesc,
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_upload_proto_goTypes,
		DependencyIndexes: file_upload_proto_depIdxs,
		EnumInfos:         file_upload_proto_enumTypes,
		MessageInfos:      file_upload_proto_msgTypes,
	}.Build()
	File_upload_proto = out.File
	file_upload_proto_rawDesc = nil
	file_upload_proto_goTypes = nil
	file_upload_proto_depIdxs = nil
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6

// FileUploadClient is the client API for FileUpload service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type FileUploadClient interface {
	//使用steam(流)关键字，用于传输二进制，字节
	Upload(ctx context.Context, opts ...grpc.CallOption) (FileUpload_UploadClient, error)
}

type fileUploadClient struct {
	cc grpc.ClientConnInterface
}

func NewFileUploadClient(cc grpc.ClientConnInterface) FileUploadClient {
	return &fileUploadClient{cc}
}

func (c *fileUploadClient) Upload(ctx context.Context, opts ...grpc.CallOption) (FileUpload_UploadClient, error) {
	stream, err := c.cc.NewStream(ctx, &_FileUpload_serviceDesc.Streams[0], "/main.FileUpload/upload", opts...)
	if err != nil {
		return nil, err
	}
	x := &fileUploadUploadClient{stream}
	return x, nil
}

type FileUpload_UploadClient interface {
	Send(*Chinl) error
	CloseAndRecv() (*UploadStar, error)
	grpc.ClientStream
}

type fileUploadUploadClient struct {
	grpc.ClientStream
}

func (x *fileUploadUploadClient) Send(m *Chinl) error {
	return x.ClientStream.SendMsg(m)
}

func (x *fileUploadUploadClient) CloseAndRecv() (*UploadStar, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(UploadStar)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// FileUploadServer is the server API for FileUpload service.
type FileUploadServer interface {
	//使用steam(流)关键字，用于传输二进制，字节
	Upload(FileUpload_UploadServer) error
}

// UnimplementedFileUploadServer can be embedded to have forward compatible implementations.
type UnimplementedFileUploadServer struct {
}

func (*UnimplementedFileUploadServer) Upload(FileUpload_UploadServer) error {
	return status.Errorf(codes.Unimplemented, "method Upload not implemented")
}

func RegisterFileUploadServer(s *grpc.Server, srv FileUploadServer) {
	s.RegisterService(&_FileUpload_serviceDesc, srv)
}

func _FileUpload_Upload_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FileUploadServer).Upload(&fileUploadUploadServer{stream})
}

type FileUpload_UploadServer interface {
	SendAndClose(*UploadStar) error
	Recv() (*Chinl, error)
	grpc.ServerStream
}

type fileUploadUploadServer struct {
	grpc.ServerStream
}

func (x *fileUploadUploadServer) SendAndClose(m *UploadStar) error {
	return x.ServerStream.SendMsg(m)
}

func (x *fileUploadUploadServer) Recv() (*Chinl, error) {
	m := new(Chinl)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _FileUpload_serviceDesc = grpc.ServiceDesc{
	ServiceName: "main.FileUpload",
	HandlerType: (*FileUploadServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "upload",
			Handler:       _FileUpload_Upload_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "upload.proto",
}
