|
@@ -28,10 +28,11 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
|
|
//服务参数
|
|
|
type ServiceMeta struct {
|
|
|
- ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"`
|
|
|
- ServiceAddr string `protobuf:"bytes,2,opt,name=serviceAddr,proto3" json:"serviceAddr,omitempty"`
|
|
|
- Workers int32 `protobuf:"varint,3,opt,name=workers,proto3" json:"workers,omitempty"`
|
|
|
- Balance int32 `protobuf:"varint,4,opt,name=balance,proto3" json:"balance,omitempty"`
|
|
|
+ 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:"-"`
|
|
@@ -62,20 +63,27 @@ func (m *ServiceMeta) XXX_DiscardUnknown() {
|
|
|
|
|
|
var xxx_messageInfo_ServiceMeta proto.InternalMessageInfo
|
|
|
|
|
|
-func (m *ServiceMeta) GetServiceName() string {
|
|
|
+func (m *ServiceMeta) GetName() string {
|
|
|
if m != nil {
|
|
|
- return m.ServiceName
|
|
|
+ return m.Name
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
-func (m *ServiceMeta) GetServiceAddr() string {
|
|
|
+func (m *ServiceMeta) GetIp() string {
|
|
|
if m != nil {
|
|
|
- return m.ServiceAddr
|
|
|
+ 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
|
|
@@ -91,39 +99,39 @@ func (m *ServiceMeta) GetBalance() int32 {
|
|
|
}
|
|
|
|
|
|
//标准字符串返回结果
|
|
|
-type StringReq struct {
|
|
|
+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 *StringReq) Reset() { *m = StringReq{} }
|
|
|
-func (m *StringReq) String() string { return proto.CompactTextString(m) }
|
|
|
-func (*StringReq) ProtoMessage() {}
|
|
|
-func (*StringReq) Descriptor() ([]byte, []int) {
|
|
|
+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 *StringReq) XXX_Unmarshal(b []byte) error {
|
|
|
- return xxx_messageInfo_StringReq.Unmarshal(m, b)
|
|
|
+func (m *StringRepData) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_StringRepData.Unmarshal(m, b)
|
|
|
}
|
|
|
-func (m *StringReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
- return xxx_messageInfo_StringReq.Marshal(b, m, deterministic)
|
|
|
+func (m *StringRepData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_StringRepData.Marshal(b, m, deterministic)
|
|
|
}
|
|
|
-func (m *StringReq) XXX_Merge(src proto.Message) {
|
|
|
- xxx_messageInfo_StringReq.Merge(m, src)
|
|
|
+func (m *StringRepData) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_StringRepData.Merge(m, src)
|
|
|
}
|
|
|
-func (m *StringReq) XXX_Size() int {
|
|
|
- return xxx_messageInfo_StringReq.Size(m)
|
|
|
+func (m *StringRepData) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_StringRepData.Size(m)
|
|
|
}
|
|
|
-func (m *StringReq) XXX_DiscardUnknown() {
|
|
|
- xxx_messageInfo_StringReq.DiscardUnknown(m)
|
|
|
+func (m *StringRepData) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_StringRepData.DiscardUnknown(m)
|
|
|
}
|
|
|
|
|
|
-var xxx_messageInfo_StringReq proto.InternalMessageInfo
|
|
|
+var xxx_messageInfo_StringRepData proto.InternalMessageInfo
|
|
|
|
|
|
-func (m *StringReq) GetData() string {
|
|
|
+func (m *StringRepData) GetData() string {
|
|
|
if m != nil {
|
|
|
return m.Data
|
|
|
}
|
|
@@ -132,7 +140,8 @@ func (m *StringReq) GetData() string {
|
|
|
|
|
|
//
|
|
|
type ApplyReqData struct {
|
|
|
- ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"`
|
|
|
+ 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:"-"`
|
|
@@ -163,16 +172,23 @@ func (m *ApplyReqData) XXX_DiscardUnknown() {
|
|
|
|
|
|
var xxx_messageInfo_ApplyReqData proto.InternalMessageInfo
|
|
|
|
|
|
-func (m *ApplyReqData) GetServiceName() string {
|
|
|
+func (m *ApplyReqData) GetName() string {
|
|
|
if m != nil {
|
|
|
- return m.ServiceName
|
|
|
+ return m.Name
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
+func (m *ApplyReqData) GetBalance() int32 {
|
|
|
+ if m != nil {
|
|
|
+ return m.Balance
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
type ApplyRepData struct {
|
|
|
- ServiceAddr string `protobuf:"bytes,1,opt,name=serviceAddr,proto3" json:"serviceAddr,omitempty"`
|
|
|
- ServiceResourceId string `protobuf:"bytes,2,opt,name=serviceResourceId,proto3" json:"serviceResourceId,omitempty"`
|
|
|
+ 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:"-"`
|
|
@@ -203,23 +219,23 @@ func (m *ApplyRepData) XXX_DiscardUnknown() {
|
|
|
|
|
|
var xxx_messageInfo_ApplyRepData proto.InternalMessageInfo
|
|
|
|
|
|
-func (m *ApplyRepData) GetServiceAddr() string {
|
|
|
+func (m *ApplyRepData) GetAddr() string {
|
|
|
if m != nil {
|
|
|
- return m.ServiceAddr
|
|
|
+ return m.Addr
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
-func (m *ApplyRepData) GetServiceResourceId() string {
|
|
|
+func (m *ApplyRepData) GetResourceId() string {
|
|
|
if m != nil {
|
|
|
- return m.ServiceResourceId
|
|
|
+ return m.ResourceId
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
func init() {
|
|
|
proto.RegisterType((*ServiceMeta)(nil), "proto.ServiceMeta")
|
|
|
- proto.RegisterType((*StringReq)(nil), "proto.StringReq")
|
|
|
+ proto.RegisterType((*StringRepData)(nil), "proto.StringRepData")
|
|
|
proto.RegisterType((*ApplyReqData)(nil), "proto.ApplyReqData")
|
|
|
proto.RegisterType((*ApplyRepData)(nil), "proto.ApplyRepData")
|
|
|
}
|
|
@@ -229,24 +245,25 @@ func init() {
|
|
|
}
|
|
|
|
|
|
var fileDescriptor_a0b84a42fa06f626 = []byte{
|
|
|
- // 272 bytes of a gzipped FileDescriptorProto
|
|
|
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x50, 0xbb, 0x4e, 0xc3, 0x30,
|
|
|
- 0x14, 0xad, 0xa1, 0x21, 0xea, 0x2d, 0x48, 0x70, 0x59, 0xac, 0x2e, 0x44, 0x9e, 0x3a, 0xa0, 0x0a,
|
|
|
- 0xda, 0x2f, 0xa8, 0xd4, 0x85, 0x01, 0x06, 0x77, 0x47, 0x72, 0x93, 0xab, 0x2a, 0x22, 0xd4, 0xa9,
|
|
|
- 0x6d, 0x40, 0xfd, 0x00, 0xfe, 0x91, 0xcf, 0x41, 0x71, 0x1c, 0x64, 0xda, 0x0e, 0x9d, 0x92, 0x7b,
|
|
|
- 0x1e, 0xf2, 0x39, 0x07, 0xae, 0x2c, 0x99, 0xcf, 0x32, 0xa7, 0x49, 0x6d, 0xb4, 0xd3, 0x98, 0xf8,
|
|
|
- 0x8f, 0xf8, 0x66, 0x30, 0x5c, 0xb6, 0xc4, 0x33, 0x39, 0x85, 0x19, 0x0c, 0x83, 0xee, 0x45, 0xbd,
|
|
|
- 0x13, 0x67, 0x19, 0x1b, 0x0f, 0x64, 0x0c, 0x45, 0x8a, 0x79, 0x51, 0x18, 0x7e, 0xf6, 0x4f, 0xd1,
|
|
|
- 0x40, 0xc8, 0x21, 0xfd, 0xd2, 0xe6, 0x8d, 0x8c, 0xe5, 0xe7, 0x19, 0x1b, 0x27, 0xb2, 0x3b, 0x1b,
|
|
|
- 0x66, 0xa5, 0x2a, 0xb5, 0xc9, 0x89, 0xf7, 0x5b, 0x26, 0x9c, 0xe2, 0x0e, 0x06, 0x4b, 0x67, 0xca,
|
|
|
- 0xcd, 0x5a, 0xd2, 0x16, 0x11, 0xfa, 0x85, 0x72, 0x2a, 0xbc, 0xee, 0xff, 0xc5, 0x03, 0x5c, 0xce,
|
|
|
- 0xeb, 0xba, 0xda, 0x49, 0xda, 0x2e, 0xd4, 0x29, 0x41, 0xc5, 0xeb, 0x9f, 0xa3, 0xde, 0x73, 0xf8,
|
|
|
- 0xe0, 0xec, 0x30, 0xf8, 0x3d, 0xdc, 0x84, 0x53, 0x92, 0xd5, 0x1f, 0x26, 0xa7, 0xa7, 0x22, 0x14,
|
|
|
- 0x3c, 0x24, 0xa6, 0x3f, 0x0c, 0xd2, 0x30, 0x1d, 0x3e, 0x42, 0x2a, 0x69, 0x5d, 0x5a, 0x47, 0x88,
|
|
|
- 0xed, 0xc0, 0x93, 0x68, 0xd5, 0xd1, 0x75, 0x87, 0x75, 0x15, 0x45, 0xaf, 0xb1, 0x2c, 0xc8, 0x3a,
|
|
|
- 0x6d, 0x76, 0x27, 0x5b, 0x66, 0x90, 0xf8, 0x46, 0x78, 0x1b, 0xc8, 0x78, 0x91, 0xd1, 0x1e, 0xe8,
|
|
|
- 0x4b, 0x8b, 0x1e, 0x4e, 0x9b, 0x68, 0x15, 0x29, 0x4b, 0x78, 0x4c, 0x71, 0xec, 0xa1, 0xd5, 0x85,
|
|
|
- 0x87, 0x66, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x8e, 0x00, 0x87, 0x34, 0x02, 0x00, 0x00,
|
|
|
+ // 278 bytes of a gzipped FileDescriptorProto
|
|
|
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x50, 0x3f, 0x4f, 0xfb, 0x30,
|
|
|
+ 0x10, 0xfd, 0x25, 0xbf, 0x86, 0x88, 0x83, 0x32, 0x1c, 0x0c, 0x56, 0x07, 0x54, 0x85, 0xa5, 0x53,
|
|
|
+ 0x07, 0x2a, 0x98, 0x58, 0x40, 0x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, 0x58, 0x11,
|
|
|
+ 0x5e, 0x41, 0x5e, 0xd2, 0xae, 0x31, 0x96, 0x10, 0x87, 0x1e, 0x97, 0x51, 0x7b, 0xb3, 0xb3, 0xc0,
|
|
|
+ 0xc5, 0x67, 0x15, 0xff, 0x9c, 0x6d, 0x4d, 0xc6, 0x2a, 0xee, 0xff, 0x64, 0x5b, 0x41, 0xe6, 0xb7,
|
|
|
+ 0xc7, 0xd3, 0x51, 0x10, 0x37, 0x31, 0xfb, 0x42, 0x06, 0xd3, 0xb5, 0x5b, 0xb1, 0x25, 0x69, 0x08,
|
|
|
+ 0x7f, 0x52, 0xfc, 0x16, 0xb6, 0x3d, 0xf0, 0xf4, 0xea, 0x23, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x1d,
|
|
|
+ 0x62, 0xee, 0x27, 0x02, 0x00, 0x00,
|
|
|
}
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
@@ -262,13 +279,13 @@ const _ = grpc.SupportPackageIsVersion6
|
|
|
// 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) (*StringReq, error)
|
|
|
+ Registe(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringRepData, error)
|
|
|
//注销服务
|
|
|
- Destory(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringReq, 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 *ApplyRepData, opts ...grpc.CallOption) (*StringReq, error)
|
|
|
+ Release(ctx context.Context, in *ApplyRepData, opts ...grpc.CallOption) (*StringRepData, error)
|
|
|
}
|
|
|
|
|
|
type serviceClient struct {
|
|
@@ -279,8 +296,8 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
|
|
|
return &serviceClient{cc}
|
|
|
}
|
|
|
|
|
|
-func (c *serviceClient) Registe(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringReq, error) {
|
|
|
- out := new(StringReq)
|
|
|
+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
|
|
@@ -288,8 +305,8 @@ func (c *serviceClient) Registe(ctx context.Context, in *ServiceMeta, opts ...gr
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
-func (c *serviceClient) Destory(ctx context.Context, in *ServiceMeta, opts ...grpc.CallOption) (*StringReq, error) {
|
|
|
- out := new(StringReq)
|
|
|
+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
|
|
@@ -306,8 +323,8 @@ func (c *serviceClient) Apply(ctx context.Context, in *ApplyReqData, opts ...grp
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
-func (c *serviceClient) Release(ctx context.Context, in *ApplyRepData, opts ...grpc.CallOption) (*StringReq, error) {
|
|
|
- out := new(StringReq)
|
|
|
+func (c *serviceClient) Release(ctx context.Context, in *ApplyRepData, 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
|
|
@@ -318,29 +335,29 @@ func (c *serviceClient) Release(ctx context.Context, in *ApplyRepData, opts ...g
|
|
|
// ServiceServer is the server API for Service service.
|
|
|
type ServiceServer interface {
|
|
|
//注册服务
|
|
|
- Registe(context.Context, *ServiceMeta) (*StringReq, error)
|
|
|
+ Registe(context.Context, *ServiceMeta) (*StringRepData, error)
|
|
|
//注销服务
|
|
|
- Destory(context.Context, *ServiceMeta) (*StringReq, error)
|
|
|
+ Destory(context.Context, *ServiceMeta) (*StringRepData, error)
|
|
|
//申请服务
|
|
|
Apply(context.Context, *ApplyReqData) (*ApplyRepData, error)
|
|
|
//释放服务
|
|
|
- Release(context.Context, *ApplyRepData) (*StringReq, error)
|
|
|
+ Release(context.Context, *ApplyRepData) (*StringRepData, error)
|
|
|
}
|
|
|
|
|
|
// UnimplementedServiceServer can be embedded to have forward compatible implementations.
|
|
|
type UnimplementedServiceServer struct {
|
|
|
}
|
|
|
|
|
|
-func (*UnimplementedServiceServer) Registe(ctx context.Context, req *ServiceMeta) (*StringReq, error) {
|
|
|
+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) (*StringReq, error) {
|
|
|
+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 *ApplyRepData) (*StringReq, error) {
|
|
|
+func (*UnimplementedServiceServer) Release(ctx context.Context, req *ApplyRepData) (*StringRepData, error) {
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Release not implemented")
|
|
|
}
|
|
|
|