|
@@ -0,0 +1,512 @@
|
|
|
|
+// 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"`
|
|
|
|
+ Meta string `protobuf:"bytes,6,opt,name=meta,proto3" json:"meta,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
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *ServiceMeta) GetMeta() string {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Meta
|
|
|
|
+ }
|
|
|
|
+ return ""
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//标准字符串返回结果
|
|
|
|
+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 {
|
|
|
|
+ Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
|
|
|
|
+ Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,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) GetIp() string {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Ip
|
|
|
|
+ }
|
|
|
|
+ return ""
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *ApplyRepData) GetPort() int32 {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Port
|
|
|
|
+ }
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+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{
|
|
|
|
+ // 279 bytes of a gzipped FileDescriptorProto
|
|
|
|
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x50, 0xb1, 0x4e, 0xc3, 0x30,
|
|
|
|
+ 0x10, 0xc5, 0xa6, 0x69, 0xc4, 0x41, 0x19, 0x0e, 0x06, 0xab, 0x53, 0x15, 0x96, 0x4e, 0x1d, 0x5a,
|
|
|
|
+ 0xc1, 0xc4, 0x82, 0xd4, 0x95, 0x25, 0xfd, 0x02, 0xb7, 0x9c, 0x2a, 0x8b, 0x34, 0x36, 0xb6, 0x05,
|
|
|
|
+ 0xea, 0x47, 0xf0, 0x97, 0x7c, 0x08, 0xb2, 0x9d, 0x80, 0xa1, 0x74, 0x60, 0xca, 0xf3, 0xbb, 0xf7,
|
|
|
|
+ 0x72, 0xef, 0x1e, 0x8c, 0x1c, 0xd9, 0x57, 0xb5, 0xa1, 0x99, 0xb1, 0xda, 0x6b, 0x2c, 0xe2, 0xa7,
|
|
|
|
+ 0x7a, 0x67, 0x70, 0xbe, 0x4a, 0x83, 0x47, 0xf2, 0x12, 0x11, 0x06, 0xad, 0xdc, 0x91, 0x60, 0x13,
|
|
|
|
+ 0x36, 0x3d, 0xab, 0x23, 0xc6, 0x4b, 0xe0, 0xca, 0x08, 0x1e, 0x19, 0xae, 0x4c, 0xd0, 0x18, 0x6d,
|
|
|
|
+ 0xbd, 0x38, 0x9d, 0xb0, 0x69, 0x51, 0x47, 0x8c, 0x02, 0xca, 0x37, 0x6d, 0x9f, 0xc9, 0x3a, 0x31,
|
|
|
|
+ 0x88, 0x74, 0xff, 0x0c, 0x93, 0xb5, 0x6c, 0x64, 0xbb, 0x21, 0x51, 0xa4, 0x49, 0xf7, 0x0c, 0xff,
|
|
|
|
+ 0xd9, 0x91, 0x97, 0x62, 0x98, 0x76, 0x05, 0x5c, 0xdd, 0xc0, 0x68, 0xe5, 0xad, 0x6a, 0xb7, 0x35,
|
|
|
|
+ 0x99, 0xa5, 0x4c, 0x81, 0x9e, 0xa4, 0x97, 0x7d, 0xa0, 0x80, 0x73, 0xd1, 0xcb, 0x51, 0xd1, 0x3d,
|
|
|
|
+ 0x5c, 0x3c, 0x18, 0xd3, 0xec, 0x33, 0xcd, 0xc1, 0x65, 0x59, 0x36, 0xfe, 0x23, 0x5b, 0x35, 0xff,
|
|
|
|
+ 0x72, 0xa7, 0x18, 0xa9, 0x03, 0x76, 0xd0, 0x01, 0xff, 0xee, 0x60, 0xfe, 0xc1, 0xa0, 0xec, 0xba,
|
|
|
|
+ 0xc4, 0x5b, 0x28, 0x6b, 0xda, 0x2a, 0xe7, 0x09, 0x31, 0x35, 0x3e, 0xcb, 0x6a, 0x1e, 0x5f, 0xf7,
|
|
|
|
+ 0x5c, 0x7e, 0x6b, 0x75, 0x12, 0x6c, 0x4b, 0x72, 0x5e, 0xdb, 0xfd, 0xbf, 0x6c, 0x0b, 0x28, 0x62,
|
|
|
|
+ 0x5a, 0xbc, 0xea, 0x04, 0xf9, 0xe5, 0xe3, 0x5f, 0x64, 0x6f, 0xba, 0x0b, 0x11, 0x1b, 0x92, 0x8e,
|
|
|
|
+ 0xf0, 0x2f, 0xc5, 0xb1, 0x65, 0xeb, 0x61, 0xa4, 0x17, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98,
|
|
|
|
+ 0xb6, 0x0b, 0x2e, 0x51, 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 *ApplyRepData, 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 *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
|
|
|
|
+ }
|
|
|
|
+ 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, *ApplyRepData) (*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 *ApplyRepData) (*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(ApplyRepData)
|
|
|
|
+ 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.(*ApplyRepData))
|
|
|
|
+ }
|
|
|
|
+ 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",
|
|
|
|
+}
|