// Code generated by protoc-gen-go. DO NOT EDIT. // source: service.proto //声明 包名 package proto import ( context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package //服务参数 type ServiceMeta struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` Workers int32 `protobuf:"varint,4,opt,name=workers,proto3" json:"workers,omitempty"` Balance int32 `protobuf:"varint,5,opt,name=balance,proto3" json:"balance,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ServiceMeta) Reset() { *m = ServiceMeta{} } func (m *ServiceMeta) String() string { return proto.CompactTextString(m) } func (*ServiceMeta) ProtoMessage() {} func (*ServiceMeta) Descriptor() ([]byte, []int) { return fileDescriptor_a0b84a42fa06f626, []int{0} } func (m *ServiceMeta) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceMeta.Unmarshal(m, b) } func (m *ServiceMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ServiceMeta.Marshal(b, m, deterministic) } func (m *ServiceMeta) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceMeta.Merge(m, src) } func (m *ServiceMeta) XXX_Size() int { return xxx_messageInfo_ServiceMeta.Size(m) } func (m *ServiceMeta) XXX_DiscardUnknown() { xxx_messageInfo_ServiceMeta.DiscardUnknown(m) } var xxx_messageInfo_ServiceMeta proto.InternalMessageInfo func (m *ServiceMeta) GetName() string { if m != nil { return m.Name } return "" } func (m *ServiceMeta) GetIp() string { if m != nil { return m.Ip } return "" } func (m *ServiceMeta) GetPort() int32 { if m != nil { return m.Port } return 0 } func (m *ServiceMeta) GetWorkers() int32 { if m != nil { return m.Workers } return 0 } func (m *ServiceMeta) GetBalance() int32 { if m != nil { return m.Balance } return 0 } //标准字符串返回结果 type StringRepData struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StringRepData) Reset() { *m = StringRepData{} } func (m *StringRepData) String() string { return proto.CompactTextString(m) } func (*StringRepData) ProtoMessage() {} func (*StringRepData) Descriptor() ([]byte, []int) { return fileDescriptor_a0b84a42fa06f626, []int{1} } func (m *StringRepData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringRepData.Unmarshal(m, b) } func (m *StringRepData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_StringRepData.Marshal(b, m, deterministic) } func (m *StringRepData) XXX_Merge(src proto.Message) { xxx_messageInfo_StringRepData.Merge(m, src) } func (m *StringRepData) XXX_Size() int { return xxx_messageInfo_StringRepData.Size(m) } func (m *StringRepData) XXX_DiscardUnknown() { xxx_messageInfo_StringRepData.DiscardUnknown(m) } var xxx_messageInfo_StringRepData proto.InternalMessageInfo func (m *StringRepData) GetData() string { if m != nil { return m.Data } return "" } //标准字符串请求 type StringReqData struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StringReqData) Reset() { *m = StringReqData{} } func (m *StringReqData) String() string { return proto.CompactTextString(m) } func (*StringReqData) ProtoMessage() {} func (*StringReqData) Descriptor() ([]byte, []int) { return fileDescriptor_a0b84a42fa06f626, []int{2} } func (m *StringReqData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringReqData.Unmarshal(m, b) } func (m *StringReqData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_StringReqData.Marshal(b, m, deterministic) } func (m *StringReqData) XXX_Merge(src proto.Message) { xxx_messageInfo_StringReqData.Merge(m, src) } func (m *StringReqData) XXX_Size() int { return xxx_messageInfo_StringReqData.Size(m) } func (m *StringReqData) XXX_DiscardUnknown() { xxx_messageInfo_StringReqData.DiscardUnknown(m) } var xxx_messageInfo_StringReqData proto.InternalMessageInfo func (m *StringReqData) GetData() string { if m != nil { return m.Data } return "" } // type ApplyReqData struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Balance int32 `protobuf:"varint,2,opt,name=balance,proto3" json:"balance,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ApplyReqData) Reset() { *m = ApplyReqData{} } func (m *ApplyReqData) String() string { return proto.CompactTextString(m) } func (*ApplyReqData) ProtoMessage() {} func (*ApplyReqData) Descriptor() ([]byte, []int) { return fileDescriptor_a0b84a42fa06f626, []int{3} } func (m *ApplyReqData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ApplyReqData.Unmarshal(m, b) } func (m *ApplyReqData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ApplyReqData.Marshal(b, m, deterministic) } func (m *ApplyReqData) XXX_Merge(src proto.Message) { xxx_messageInfo_ApplyReqData.Merge(m, src) } func (m *ApplyReqData) XXX_Size() int { return xxx_messageInfo_ApplyReqData.Size(m) } func (m *ApplyReqData) XXX_DiscardUnknown() { xxx_messageInfo_ApplyReqData.DiscardUnknown(m) } var xxx_messageInfo_ApplyReqData proto.InternalMessageInfo func (m *ApplyReqData) GetName() string { if m != nil { return m.Name } return "" } func (m *ApplyReqData) GetBalance() int32 { if m != nil { return m.Balance } return 0 } type ApplyRepData struct { Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` ResourceId string `protobuf:"bytes,2,opt,name=resourceId,proto3" json:"resourceId,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ApplyRepData) Reset() { *m = ApplyRepData{} } func (m *ApplyRepData) String() string { return proto.CompactTextString(m) } func (*ApplyRepData) ProtoMessage() {} func (*ApplyRepData) Descriptor() ([]byte, []int) { return fileDescriptor_a0b84a42fa06f626, []int{4} } func (m *ApplyRepData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ApplyRepData.Unmarshal(m, b) } func (m *ApplyRepData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ApplyRepData.Marshal(b, m, deterministic) } func (m *ApplyRepData) XXX_Merge(src proto.Message) { xxx_messageInfo_ApplyRepData.Merge(m, src) } func (m *ApplyRepData) XXX_Size() int { return xxx_messageInfo_ApplyRepData.Size(m) } func (m *ApplyRepData) XXX_DiscardUnknown() { xxx_messageInfo_ApplyRepData.DiscardUnknown(m) } var xxx_messageInfo_ApplyRepData proto.InternalMessageInfo func (m *ApplyRepData) GetAddr() string { if m != nil { return m.Addr } return "" } func (m *ApplyRepData) GetResourceId() string { if m != nil { return m.ResourceId } return "" } func init() { proto.RegisterType((*ServiceMeta)(nil), "proto.ServiceMeta") proto.RegisterType((*StringRepData)(nil), "proto.StringRepData") proto.RegisterType((*StringReqData)(nil), "proto.StringReqData") proto.RegisterType((*ApplyReqData)(nil), "proto.ApplyReqData") proto.RegisterType((*ApplyRepData)(nil), "proto.ApplyRepData") } func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) } var fileDescriptor_a0b84a42fa06f626 = []byte{ // 282 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x50, 0xb1, 0x4e, 0x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d5, 0xd0, 0x45, 0xc4, 0xdc, 0x7e, 0x27, 0x30, 0x1e, 0x7a, 0xc4, 0x3b, 0x18, 0x17, 0xb4, 0xad, 0x8d, 0x25, 0xc4, 0xbe, 0xec, 0x45, 0x54, 0xf1, 0xf4, 0x2a, 0x70, 0xf1, 0xed, 0xf9, 0x91, 0xb3, 0xad, 0xc8, 0x58, 0xc5, 0xdd, 0xbf, 0x6c, 0x4b, 0xc8, 0x7c, 0x7a, 0xbc, 0x1c, 0x04, 0x71, 0x13, 0xd3, 0x3d, 0x32, 0x98, 0xee, 0x5d, 0xc4, 0x86, 0xa4, 0x21, 0xdc, 0xff, 0x6f, 0xef, 0x3b, 0xb0, 0x6d, 0x73, 0xe2, 0xe9, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x2d, 0x4a, 0xbc, 0x4d, 0x02, 0x00, 0x00, } // 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 // ServiceClient is the client API for Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ServiceClient interface { //注册服务 Registe(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringRepData, error) //注销服务 Destory(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringRepData, error) //申请服务 Apply(ctx context.Context, in *ApplyReqData, opts ...grpc.CallOption) (*ApplyRepData, error) //释放服务 Release(ctx context.Context, in *StringReqData, opts ...grpc.CallOption) (*StringRepData, error) } type serviceClient struct { cc grpc.ClientConnInterface } func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { return &serviceClient{cc} } func (c *serviceClient) Registe(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringRepData, error) { out := new(StringRepData) err := c.cc.Invoke(ctx, "/proto.Service/Registe", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *serviceClient) Destory(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringRepData, error) { out := new(StringRepData) err := c.cc.Invoke(ctx, "/proto.Service/Destory", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *serviceClient) Apply(ctx context.Context, in *ApplyReqData, opts ...grpc.CallOption) (*ApplyRepData, error) { out := new(ApplyRepData) err := c.cc.Invoke(ctx, "/proto.Service/Apply", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *serviceClient) Release(ctx context.Context, in *StringReqData, opts ...grpc.CallOption) (*StringRepData, error) { out := new(StringRepData) err := c.cc.Invoke(ctx, "/proto.Service/Release", in, out, opts...) if err != nil { return nil, err } return out, nil } // ServiceServer is the server API for Service service. type ServiceServer interface { //注册服务 Registe(context.Context, *ServiceMeta) (*StringRepData, error) //注销服务 Destory(context.Context, *ServiceMeta) (*StringRepData, error) //申请服务 Apply(context.Context, *ApplyReqData) (*ApplyRepData, error) //释放服务 Release(context.Context, *StringReqData) (*StringRepData, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. type UnimplementedServiceServer struct { } func (*UnimplementedServiceServer) Registe(ctx context.Context, req *ServiceMeta) (*StringRepData, error) { return nil, status.Errorf(codes.Unimplemented, "method Registe not implemented") } func (*UnimplementedServiceServer) Destory(ctx context.Context, req *ServiceMeta) (*StringRepData, error) { return nil, status.Errorf(codes.Unimplemented, "method Destory not implemented") } func (*UnimplementedServiceServer) Apply(ctx context.Context, req *ApplyReqData) (*ApplyRepData, error) { return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented") } func (*UnimplementedServiceServer) Release(ctx context.Context, req *StringReqData) (*StringRepData, error) { return nil, status.Errorf(codes.Unimplemented, "method Release not implemented") } func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } func _Service_Registe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ServiceMeta) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ServiceServer).Registe(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/proto.Service/Registe", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Registe(ctx, req.(*ServiceMeta)) } return interceptor(ctx, in, info, handler) } func _Service_Destory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ServiceMeta) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ServiceServer).Destory(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/proto.Service/Destory", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Destory(ctx, req.(*ServiceMeta)) } return interceptor(ctx, in, info, handler) } func _Service_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ApplyReqData) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ServiceServer).Apply(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/proto.Service/Apply", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Apply(ctx, req.(*ApplyReqData)) } return interceptor(ctx, in, info, handler) } func _Service_Release_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StringReqData) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ServiceServer).Release(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/proto.Service/Release", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceServer).Release(ctx, req.(*StringReqData)) } return interceptor(ctx, in, info, handler) } var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "proto.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Registe", Handler: _Service_Registe_Handler, }, { MethodName: "Destory", Handler: _Service_Destory_Handler, }, { MethodName: "Apply", Handler: _Service_Apply_Handler, }, { MethodName: "Release", Handler: _Service_Release_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }