diff --git a/cmd.pb.go b/cmd.pb.go index 95321ca..3cffd30 100644 --- a/cmd.pb.go +++ b/cmd.pb.go @@ -355,6 +355,7 @@ type SaasReq struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Cmd: // + // *SaasReq_Info // *SaasReq_Read // *SaasReq_Write // *SaasReq_ColumnWrite @@ -409,6 +410,15 @@ func (x *SaasReq) GetCmd() isSaasReq_Cmd { return nil } +func (x *SaasReq) GetInfo() *Info { + if x != nil { + if x, ok := x.Cmd.(*SaasReq_Info); ok { + return x.Info + } + } + return nil +} + func (x *SaasReq) GetRead() *Read { if x != nil { if x, ok := x.Cmd.(*SaasReq_Read); ok { @@ -521,6 +531,10 @@ type isSaasReq_Cmd interface { isSaasReq_Cmd() } +type SaasReq_Info struct { + Info *Info `protobuf:"bytes,5,opt,name=info,proto3,oneof"` // 获取账号设置 +} + type SaasReq_Read struct { Read *Read `protobuf:"bytes,10,opt,name=read,proto3,oneof"` // 批量读取 } @@ -569,6 +583,8 @@ type SaasReq_Debug struct { Debug *Debug `protobuf:"bytes,90,opt,name=debug,proto3,oneof"` // 试运行lua脚本 } +func (*SaasReq_Info) isSaasReq_Cmd() {} + func (*SaasReq_Read) isSaasReq_Cmd() {} func (*SaasReq_Write) isSaasReq_Cmd() {} @@ -593,6 +609,43 @@ func (*SaasReq_BindDelete) isSaasReq_Cmd() {} func (*SaasReq_Debug) isSaasReq_Cmd() {} +// Info 获取账号信息 +type Info struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Info) Reset() { + *x = Info{} + mi := &file_cmd_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Info) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Info) ProtoMessage() {} + +func (x *Info) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Info.ProtoReflect.Descriptor instead. +func (*Info) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{1} +} + // Read 批量读取命令 type Read struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -605,7 +658,7 @@ type Read struct { func (x *Read) Reset() { *x = Read{} - mi := &file_cmd_proto_msgTypes[1] + mi := &file_cmd_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +670,7 @@ func (x *Read) String() string { func (*Read) ProtoMessage() {} func (x *Read) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[1] + mi := &file_cmd_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -630,7 +683,7 @@ func (x *Read) ProtoReflect() protoreflect.Message { // Deprecated: Use Read.ProtoReflect.Descriptor instead. func (*Read) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{1} + return file_cmd_proto_rawDescGZIP(), []int{2} } func (x *Read) GetDataspaceId() string { @@ -664,7 +717,7 @@ type ReadItem struct { func (x *ReadItem) Reset() { *x = ReadItem{} - mi := &file_cmd_proto_msgTypes[2] + mi := &file_cmd_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -676,7 +729,7 @@ func (x *ReadItem) String() string { func (*ReadItem) ProtoMessage() {} func (x *ReadItem) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[2] + mi := &file_cmd_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -689,7 +742,7 @@ func (x *ReadItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadItem.ProtoReflect.Descriptor instead. func (*ReadItem) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{2} + return file_cmd_proto_rawDescGZIP(), []int{3} } func (x *ReadItem) GetUserid() string { @@ -712,7 +765,7 @@ type Write struct { func (x *Write) Reset() { *x = Write{} - mi := &file_cmd_proto_msgTypes[3] + mi := &file_cmd_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +777,7 @@ func (x *Write) String() string { func (*Write) ProtoMessage() {} func (x *Write) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[3] + mi := &file_cmd_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -737,7 +790,7 @@ func (x *Write) ProtoReflect() protoreflect.Message { // Deprecated: Use Write.ProtoReflect.Descriptor instead. func (*Write) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{3} + return file_cmd_proto_rawDescGZIP(), []int{4} } func (x *Write) GetDataspaceId() string { @@ -781,7 +834,7 @@ type WriteItem struct { func (x *WriteItem) Reset() { *x = WriteItem{} - mi := &file_cmd_proto_msgTypes[4] + mi := &file_cmd_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -793,7 +846,7 @@ func (x *WriteItem) String() string { func (*WriteItem) ProtoMessage() {} func (x *WriteItem) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[4] + mi := &file_cmd_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -806,7 +859,7 @@ func (x *WriteItem) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteItem.ProtoReflect.Descriptor instead. func (*WriteItem) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{4} + return file_cmd_proto_rawDescGZIP(), []int{5} } func (x *WriteItem) GetUserid() string { @@ -849,7 +902,7 @@ type Bytes struct { func (x *Bytes) Reset() { *x = Bytes{} - mi := &file_cmd_proto_msgTypes[5] + mi := &file_cmd_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -861,7 +914,7 @@ func (x *Bytes) String() string { func (*Bytes) ProtoMessage() {} func (x *Bytes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[5] + mi := &file_cmd_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -874,7 +927,7 @@ func (x *Bytes) ProtoReflect() protoreflect.Message { // Deprecated: Use Bytes.ProtoReflect.Descriptor instead. func (*Bytes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{5} + return file_cmd_proto_rawDescGZIP(), []int{6} } func (x *Bytes) GetBytes() []byte { @@ -909,7 +962,7 @@ type Uint32S struct { func (x *Uint32S) Reset() { *x = Uint32S{} - mi := &file_cmd_proto_msgTypes[6] + mi := &file_cmd_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -921,7 +974,7 @@ func (x *Uint32S) String() string { func (*Uint32S) ProtoMessage() {} func (x *Uint32S) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[6] + mi := &file_cmd_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -934,7 +987,7 @@ func (x *Uint32S) ProtoReflect() protoreflect.Message { // Deprecated: Use Uint32S.ProtoReflect.Descriptor instead. func (*Uint32S) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{6} + return file_cmd_proto_rawDescGZIP(), []int{7} } func (x *Uint32S) GetUint32S() []uint32 { @@ -962,7 +1015,7 @@ type FlagsWithExpire struct { func (x *FlagsWithExpire) Reset() { *x = FlagsWithExpire{} - mi := &file_cmd_proto_msgTypes[7] + mi := &file_cmd_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -974,7 +1027,7 @@ func (x *FlagsWithExpire) String() string { func (*FlagsWithExpire) ProtoMessage() {} func (x *FlagsWithExpire) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[7] + mi := &file_cmd_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -987,7 +1040,7 @@ func (x *FlagsWithExpire) ProtoReflect() protoreflect.Message { // Deprecated: Use FlagsWithExpire.ProtoReflect.Descriptor instead. func (*FlagsWithExpire) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{7} + return file_cmd_proto_rawDescGZIP(), []int{8} } func (x *FlagsWithExpire) GetFlagsWithExpire() []*FlagWithExpire { @@ -1016,7 +1069,7 @@ type FlagWithExpire struct { func (x *FlagWithExpire) Reset() { *x = FlagWithExpire{} - mi := &file_cmd_proto_msgTypes[8] + mi := &file_cmd_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1028,7 +1081,7 @@ func (x *FlagWithExpire) String() string { func (*FlagWithExpire) ProtoMessage() {} func (x *FlagWithExpire) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[8] + mi := &file_cmd_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1041,7 +1094,7 @@ func (x *FlagWithExpire) ProtoReflect() protoreflect.Message { // Deprecated: Use FlagWithExpire.ProtoReflect.Descriptor instead. func (*FlagWithExpire) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{8} + return file_cmd_proto_rawDescGZIP(), []int{9} } func (x *FlagWithExpire) GetFlag() bool { @@ -1079,7 +1132,7 @@ type ColumnWrite struct { func (x *ColumnWrite) Reset() { *x = ColumnWrite{} - mi := &file_cmd_proto_msgTypes[9] + mi := &file_cmd_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1091,7 +1144,7 @@ func (x *ColumnWrite) String() string { func (*ColumnWrite) ProtoMessage() {} func (x *ColumnWrite) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[9] + mi := &file_cmd_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1104,7 +1157,7 @@ func (x *ColumnWrite) ProtoReflect() protoreflect.Message { // Deprecated: Use ColumnWrite.ProtoReflect.Descriptor instead. func (*ColumnWrite) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{9} + return file_cmd_proto_rawDescGZIP(), []int{10} } func (x *ColumnWrite) GetDataspaceId() string { @@ -1163,7 +1216,7 @@ type Task struct { func (x *Task) Reset() { *x = Task{} - mi := &file_cmd_proto_msgTypes[10] + mi := &file_cmd_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1175,7 +1228,7 @@ func (x *Task) String() string { func (*Task) ProtoMessage() {} func (x *Task) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[10] + mi := &file_cmd_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1188,7 +1241,7 @@ func (x *Task) ProtoReflect() protoreflect.Message { // Deprecated: Use Task.ProtoReflect.Descriptor instead. func (*Task) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{10} + return file_cmd_proto_rawDescGZIP(), []int{11} } func (x *Task) GetDataspaceId() string { @@ -1285,7 +1338,7 @@ type TaskList struct { func (x *TaskList) Reset() { *x = TaskList{} - mi := &file_cmd_proto_msgTypes[11] + mi := &file_cmd_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1297,7 +1350,7 @@ func (x *TaskList) String() string { func (*TaskList) ProtoMessage() {} func (x *TaskList) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[11] + mi := &file_cmd_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1310,7 +1363,7 @@ func (x *TaskList) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskList.ProtoReflect.Descriptor instead. func (*TaskList) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{11} + return file_cmd_proto_rawDescGZIP(), []int{12} } func (x *TaskList) GetStatusFilter() TaskStatus { @@ -1330,7 +1383,7 @@ type TaskRun struct { func (x *TaskRun) Reset() { *x = TaskRun{} - mi := &file_cmd_proto_msgTypes[12] + mi := &file_cmd_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1342,7 +1395,7 @@ func (x *TaskRun) String() string { func (*TaskRun) ProtoMessage() {} func (x *TaskRun) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[12] + mi := &file_cmd_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1355,7 +1408,7 @@ func (x *TaskRun) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskRun.ProtoReflect.Descriptor instead. func (*TaskRun) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{12} + return file_cmd_proto_rawDescGZIP(), []int{13} } func (x *TaskRun) GetTaskSha256() string { @@ -1375,7 +1428,7 @@ type TaskDelete struct { func (x *TaskDelete) Reset() { *x = TaskDelete{} - mi := &file_cmd_proto_msgTypes[13] + mi := &file_cmd_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1387,7 +1440,7 @@ func (x *TaskDelete) String() string { func (*TaskDelete) ProtoMessage() {} func (x *TaskDelete) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[13] + mi := &file_cmd_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1400,7 +1453,7 @@ func (x *TaskDelete) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskDelete.ProtoReflect.Descriptor instead. func (*TaskDelete) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{13} + return file_cmd_proto_rawDescGZIP(), []int{14} } func (x *TaskDelete) GetTaskSha256() string { @@ -1420,7 +1473,7 @@ type TaskInfo struct { func (x *TaskInfo) Reset() { *x = TaskInfo{} - mi := &file_cmd_proto_msgTypes[14] + mi := &file_cmd_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1432,7 +1485,7 @@ func (x *TaskInfo) String() string { func (*TaskInfo) ProtoMessage() {} func (x *TaskInfo) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[14] + mi := &file_cmd_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1445,7 +1498,7 @@ func (x *TaskInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskInfo.ProtoReflect.Descriptor instead. func (*TaskInfo) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{14} + return file_cmd_proto_rawDescGZIP(), []int{15} } func (x *TaskInfo) GetTaskSha256() string { @@ -1467,7 +1520,7 @@ type FileInfo struct { func (x *FileInfo) Reset() { *x = FileInfo{} - mi := &file_cmd_proto_msgTypes[15] + mi := &file_cmd_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1479,7 +1532,7 @@ func (x *FileInfo) String() string { func (*FileInfo) ProtoMessage() {} func (x *FileInfo) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[15] + mi := &file_cmd_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1492,7 +1545,7 @@ func (x *FileInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use FileInfo.ProtoReflect.Descriptor instead. func (*FileInfo) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{15} + return file_cmd_proto_rawDescGZIP(), []int{16} } func (x *FileInfo) GetFileName() string { @@ -1528,7 +1581,7 @@ type FileBlock struct { func (x *FileBlock) Reset() { *x = FileBlock{} - mi := &file_cmd_proto_msgTypes[16] + mi := &file_cmd_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1540,7 +1593,7 @@ func (x *FileBlock) String() string { func (*FileBlock) ProtoMessage() {} func (x *FileBlock) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[16] + mi := &file_cmd_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1553,7 +1606,7 @@ func (x *FileBlock) ProtoReflect() protoreflect.Message { // Deprecated: Use FileBlock.ProtoReflect.Descriptor instead. func (*FileBlock) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{16} + return file_cmd_proto_rawDescGZIP(), []int{17} } func (x *FileBlock) GetBlockSha256() string { @@ -1588,7 +1641,7 @@ type TargetList struct { func (x *TargetList) Reset() { *x = TargetList{} - mi := &file_cmd_proto_msgTypes[17] + mi := &file_cmd_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1600,7 +1653,7 @@ func (x *TargetList) String() string { func (*TargetList) ProtoMessage() {} func (x *TargetList) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[17] + mi := &file_cmd_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1613,7 +1666,7 @@ func (x *TargetList) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetList.ProtoReflect.Descriptor instead. func (*TargetList) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{17} + return file_cmd_proto_rawDescGZIP(), []int{18} } func (x *TargetList) GetTargets() []string { @@ -1640,7 +1693,7 @@ type BindSet struct { func (x *BindSet) Reset() { *x = BindSet{} - mi := &file_cmd_proto_msgTypes[18] + mi := &file_cmd_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1652,7 +1705,7 @@ func (x *BindSet) String() string { func (*BindSet) ProtoMessage() {} func (x *BindSet) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[18] + mi := &file_cmd_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1665,7 +1718,7 @@ func (x *BindSet) ProtoReflect() protoreflect.Message { // Deprecated: Use BindSet.ProtoReflect.Descriptor instead. func (*BindSet) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{18} + return file_cmd_proto_rawDescGZIP(), []int{19} } func (x *BindSet) GetBinds() []*Bind { @@ -1685,7 +1738,7 @@ type BindDelete struct { func (x *BindDelete) Reset() { *x = BindDelete{} - mi := &file_cmd_proto_msgTypes[19] + mi := &file_cmd_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1697,7 +1750,7 @@ func (x *BindDelete) String() string { func (*BindDelete) ProtoMessage() {} func (x *BindDelete) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[19] + mi := &file_cmd_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1710,7 +1763,7 @@ func (x *BindDelete) ProtoReflect() protoreflect.Message { // Deprecated: Use BindDelete.ProtoReflect.Descriptor instead. func (*BindDelete) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{19} + return file_cmd_proto_rawDescGZIP(), []int{20} } func (x *BindDelete) GetBinds() []*Bind { @@ -1736,7 +1789,7 @@ type Debug struct { func (x *Debug) Reset() { *x = Debug{} - mi := &file_cmd_proto_msgTypes[20] + mi := &file_cmd_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1748,7 +1801,7 @@ func (x *Debug) String() string { func (*Debug) ProtoMessage() {} func (x *Debug) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[20] + mi := &file_cmd_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1761,7 +1814,7 @@ func (x *Debug) ProtoReflect() protoreflect.Message { // Deprecated: Use Debug.ProtoReflect.Descriptor instead. func (*Debug) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{20} + return file_cmd_proto_rawDescGZIP(), []int{21} } func (x *Debug) GetLuaScript() string { @@ -1820,6 +1873,7 @@ type SaasRes struct { Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // 返回信息的文本提示 // Types that are valid to be assigned to Res: // + // *SaasRes_InfoRes // *SaasRes_ReadRes // *SaasRes_WriteRes // *SaasRes_TaskCreateRes @@ -1837,7 +1891,7 @@ type SaasRes struct { func (x *SaasRes) Reset() { *x = SaasRes{} - mi := &file_cmd_proto_msgTypes[21] + mi := &file_cmd_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1849,7 +1903,7 @@ func (x *SaasRes) String() string { func (*SaasRes) ProtoMessage() {} func (x *SaasRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[21] + mi := &file_cmd_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1862,7 +1916,7 @@ func (x *SaasRes) ProtoReflect() protoreflect.Message { // Deprecated: Use SaasRes.ProtoReflect.Descriptor instead. func (*SaasRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{21} + return file_cmd_proto_rawDescGZIP(), []int{22} } func (x *SaasRes) GetCode() ErrorCode { @@ -1886,6 +1940,15 @@ func (x *SaasRes) GetRes() isSaasRes_Res { return nil } +func (x *SaasRes) GetInfoRes() *InfoRes { + if x != nil { + if x, ok := x.Res.(*SaasRes_InfoRes); ok { + return x.InfoRes + } + } + return nil +} + func (x *SaasRes) GetReadRes() *ReadRes { if x != nil { if x, ok := x.Res.(*SaasRes_ReadRes); ok { @@ -1980,6 +2043,10 @@ type isSaasRes_Res interface { isSaasRes_Res() } +type SaasRes_InfoRes struct { + InfoRes *InfoRes `protobuf:"bytes,5,opt,name=info_res,json=infoRes,proto3,oneof"` // 账号信息返回 +} + type SaasRes_ReadRes struct { ReadRes *ReadRes `protobuf:"bytes,10,opt,name=read_res,json=readRes,proto3,oneof"` // 读取命令返回 } @@ -2020,6 +2087,8 @@ type SaasRes_BindDeleteRes struct { BindDeleteRes *BindDeleteRes `protobuf:"bytes,62,opt,name=bind_delete_res,json=bindDeleteRes,proto3,oneof"` // 删除绑定返回状态 } +func (*SaasRes_InfoRes) isSaasRes_Res() {} + func (*SaasRes_ReadRes) isSaasRes_Res() {} func (*SaasRes_WriteRes) isSaasRes_Res() {} @@ -2040,6 +2109,59 @@ func (*SaasRes_BindSetRes) isSaasRes_Res() {} func (*SaasRes_BindDeleteRes) isSaasRes_Res() {} +// InfoRes 账号信息返回 +type InfoRes struct { + state protoimpl.MessageState `protogen:"open.v1"` + DataspaceId []string `protobuf:"bytes,1,rep,name=dataspace_id,json=dataspaceId,proto3" json:"dataspace_id,omitempty"` // 可用数据区 + TargetId []string `protobuf:"bytes,2,rep,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` // 策略ID + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InfoRes) Reset() { + *x = InfoRes{} + mi := &file_cmd_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoRes) ProtoMessage() {} + +func (x *InfoRes) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfoRes.ProtoReflect.Descriptor instead. +func (*InfoRes) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{23} +} + +func (x *InfoRes) GetDataspaceId() []string { + if x != nil { + return x.DataspaceId + } + return nil +} + +func (x *InfoRes) GetTargetId() []string { + if x != nil { + return x.TargetId + } + return nil +} + // ReadRes 读记录返回 type ReadRes struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2052,7 +2174,7 @@ type ReadRes struct { func (x *ReadRes) Reset() { *x = ReadRes{} - mi := &file_cmd_proto_msgTypes[22] + mi := &file_cmd_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2064,7 +2186,7 @@ func (x *ReadRes) String() string { func (*ReadRes) ProtoMessage() {} func (x *ReadRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[22] + mi := &file_cmd_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2077,7 +2199,7 @@ func (x *ReadRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadRes.ProtoReflect.Descriptor instead. func (*ReadRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{22} + return file_cmd_proto_rawDescGZIP(), []int{24} } func (x *ReadRes) GetSuccCmdCount() uint32 { @@ -2113,7 +2235,7 @@ type WriteRes struct { func (x *WriteRes) Reset() { *x = WriteRes{} - mi := &file_cmd_proto_msgTypes[23] + mi := &file_cmd_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2125,7 +2247,7 @@ func (x *WriteRes) String() string { func (*WriteRes) ProtoMessage() {} func (x *WriteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[23] + mi := &file_cmd_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2138,7 +2260,7 @@ func (x *WriteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteRes.ProtoReflect.Descriptor instead. func (*WriteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{23} + return file_cmd_proto_rawDescGZIP(), []int{25} } func (x *WriteRes) GetFailedUserid() []string { @@ -2163,7 +2285,7 @@ type ValueItem struct { func (x *ValueItem) Reset() { *x = ValueItem{} - mi := &file_cmd_proto_msgTypes[24] + mi := &file_cmd_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2175,7 +2297,7 @@ func (x *ValueItem) String() string { func (*ValueItem) ProtoMessage() {} func (x *ValueItem) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[24] + mi := &file_cmd_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2188,7 +2310,7 @@ func (x *ValueItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ValueItem.ProtoReflect.Descriptor instead. func (*ValueItem) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{24} + return file_cmd_proto_rawDescGZIP(), []int{26} } func (x *ValueItem) GetCmdIndex() uint32 { @@ -2243,7 +2365,7 @@ type TaskListRes struct { func (x *TaskListRes) Reset() { *x = TaskListRes{} - mi := &file_cmd_proto_msgTypes[25] + mi := &file_cmd_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2255,7 +2377,7 @@ func (x *TaskListRes) String() string { func (*TaskListRes) ProtoMessage() {} func (x *TaskListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[25] + mi := &file_cmd_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2268,7 +2390,7 @@ func (x *TaskListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskListRes.ProtoReflect.Descriptor instead. func (*TaskListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{25} + return file_cmd_proto_rawDescGZIP(), []int{27} } func (x *TaskListRes) GetTasks() []*Task { @@ -2288,7 +2410,7 @@ type TargetListRes struct { func (x *TargetListRes) Reset() { *x = TargetListRes{} - mi := &file_cmd_proto_msgTypes[26] + mi := &file_cmd_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2300,7 +2422,7 @@ func (x *TargetListRes) String() string { func (*TargetListRes) ProtoMessage() {} func (x *TargetListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[26] + mi := &file_cmd_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2313,7 +2435,7 @@ func (x *TargetListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetListRes.ProtoReflect.Descriptor instead. func (*TargetListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{26} + return file_cmd_proto_rawDescGZIP(), []int{28} } func (x *TargetListRes) GetTargetList() map[string]*Binds { @@ -2332,7 +2454,7 @@ type Binds struct { func (x *Binds) Reset() { *x = Binds{} - mi := &file_cmd_proto_msgTypes[27] + mi := &file_cmd_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2344,7 +2466,7 @@ func (x *Binds) String() string { func (*Binds) ProtoMessage() {} func (x *Binds) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[27] + mi := &file_cmd_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2357,7 +2479,7 @@ func (x *Binds) ProtoReflect() protoreflect.Message { // Deprecated: Use Binds.ProtoReflect.Descriptor instead. func (*Binds) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{27} + return file_cmd_proto_rawDescGZIP(), []int{29} } func (x *Binds) GetBinds() []*Bind { @@ -2381,7 +2503,7 @@ type Bind struct { func (x *Bind) Reset() { *x = Bind{} - mi := &file_cmd_proto_msgTypes[28] + mi := &file_cmd_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2393,7 +2515,7 @@ func (x *Bind) String() string { func (*Bind) ProtoMessage() {} func (x *Bind) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[28] + mi := &file_cmd_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2406,7 +2528,7 @@ func (x *Bind) ProtoReflect() protoreflect.Message { // Deprecated: Use Bind.ProtoReflect.Descriptor instead. func (*Bind) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{28} + return file_cmd_proto_rawDescGZIP(), []int{30} } func (x *Bind) GetBindId() int64 { @@ -2456,7 +2578,7 @@ type BindSetRes struct { func (x *BindSetRes) Reset() { *x = BindSetRes{} - mi := &file_cmd_proto_msgTypes[29] + mi := &file_cmd_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2468,7 +2590,7 @@ func (x *BindSetRes) String() string { func (*BindSetRes) ProtoMessage() {} func (x *BindSetRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[29] + mi := &file_cmd_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2481,7 +2603,7 @@ func (x *BindSetRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindSetRes.ProtoReflect.Descriptor instead. func (*BindSetRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{29} + return file_cmd_proto_rawDescGZIP(), []int{31} } func (x *BindSetRes) GetSuccessNum() int32 { @@ -2517,7 +2639,7 @@ type BindDeleteRes struct { func (x *BindDeleteRes) Reset() { *x = BindDeleteRes{} - mi := &file_cmd_proto_msgTypes[30] + mi := &file_cmd_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2529,7 +2651,7 @@ func (x *BindDeleteRes) String() string { func (*BindDeleteRes) ProtoMessage() {} func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[30] + mi := &file_cmd_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2542,7 +2664,7 @@ func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindDeleteRes.ProtoReflect.Descriptor instead. func (*BindDeleteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{30} + return file_cmd_proto_rawDescGZIP(), []int{32} } func (x *BindDeleteRes) GetSuccessNum() int32 { @@ -2578,7 +2700,7 @@ type BindError struct { func (x *BindError) Reset() { *x = BindError{} - mi := &file_cmd_proto_msgTypes[31] + mi := &file_cmd_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2590,7 +2712,7 @@ func (x *BindError) String() string { func (*BindError) ProtoMessage() {} func (x *BindError) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[31] + mi := &file_cmd_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2603,7 +2725,7 @@ func (x *BindError) ProtoReflect() protoreflect.Message { // Deprecated: Use BindError.ProtoReflect.Descriptor instead. func (*BindError) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{31} + return file_cmd_proto_rawDescGZIP(), []int{33} } func (x *BindError) GetBindId() int64 { @@ -2639,7 +2761,7 @@ type DebugRes struct { func (x *DebugRes) Reset() { *x = DebugRes{} - mi := &file_cmd_proto_msgTypes[32] + mi := &file_cmd_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2651,7 +2773,7 @@ func (x *DebugRes) String() string { func (*DebugRes) ProtoMessage() {} func (x *DebugRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[32] + mi := &file_cmd_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2664,7 +2786,7 @@ func (x *DebugRes) ProtoReflect() protoreflect.Message { // Deprecated: Use DebugRes.ProtoReflect.Descriptor instead. func (*DebugRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{32} + return file_cmd_proto_rawDescGZIP(), []int{34} } func (x *DebugRes) GetPrintOutput() string { @@ -2692,8 +2814,9 @@ var File_cmd_proto protoreflect.FileDescriptor const file_cmd_proto_rawDesc = "" + "\n" + - "\tcmd.proto\x12\asaasapi\"\xdc\x04\n" + + "\tcmd.proto\x12\asaasapi\"\x81\x05\n" + "\aSaasReq\x12#\n" + + "\x04info\x18\x05 \x01(\v2\r.saasapi.InfoH\x00R\x04info\x12#\n" + "\x04read\x18\n" + " \x01(\v2\r.saasapi.ReadH\x00R\x04read\x12&\n" + "\x05write\x18\v \x01(\v2\x0e.saasapi.WriteH\x00R\x05write\x129\n" + @@ -2711,7 +2834,8 @@ const file_cmd_proto_rawDesc = "" + "\vbind_delete\x18> \x01(\v2\x13.saasapi.BindDeleteH\x00R\n" + "bindDelete\x12&\n" + "\x05debug\x18Z \x01(\v2\x0e.saasapi.DebugH\x00R\x05debugB\x05\n" + - "\x03cmd\"q\n" + + "\x03cmd\"\x06\n" + + "\x04Info\"q\n" + "\x04Read\x12!\n" + "\fdataspace_id\x18\x01 \x01(\tR\vdataspaceId\x12\x14\n" + "\x05appid\x18\x02 \x01(\tR\x05appid\x120\n" + @@ -2809,10 +2933,11 @@ const file_cmd_proto_rawDesc = "" + "\x05appid\x18\x04 \x01(\tR\x05appid\x12#\n" + "\rserver_openid\x18\x05 \x01(\tR\fserverOpenid\x128\n" + "\x0elocal_did_data\x18\x06 \x01(\v2\x12.saasapi.WriteItemR\flocalDidData\x12>\n" + - "\x11local_openid_data\x18\a \x01(\v2\x12.saasapi.WriteItemR\x0flocalOpenidData\"\x84\x05\n" + + "\x11local_openid_data\x18\a \x01(\v2\x12.saasapi.WriteItemR\x0flocalOpenidData\"\xb3\x05\n" + "\aSaasRes\x12&\n" + "\x04code\x18\x01 \x01(\x0e2\x12.saasapi.ErrorCodeR\x04code\x12\x16\n" + "\x06status\x18\x02 \x01(\tR\x06status\x12-\n" + + "\binfo_res\x18\x05 \x01(\v2\x10.saasapi.InfoResH\x00R\ainfoRes\x12-\n" + "\bread_res\x18\n" + " \x01(\v2\x10.saasapi.ReadResH\x00R\areadRes\x120\n" + "\twrite_res\x18\v \x01(\v2\x11.saasapi.WriteResH\x00R\bwriteRes\x127\n" + @@ -2826,7 +2951,10 @@ const file_cmd_proto_rawDesc = "" + "\fbind_set_res\x18= \x01(\v2\x13.saasapi.BindSetResH\x00R\n" + "bindSetRes\x12@\n" + "\x0fbind_delete_res\x18> \x01(\v2\x16.saasapi.BindDeleteResH\x00R\rbindDeleteResB\x05\n" + - "\x03res\"\x82\x01\n" + + "\x03res\"I\n" + + "\aInfoRes\x12!\n" + + "\fdataspace_id\x18\x01 \x03(\tR\vdataspaceId\x12\x1b\n" + + "\ttarget_id\x18\x02 \x03(\tR\btargetId\"\x82\x01\n" + "\aReadRes\x12$\n" + "\x0esucc_cmd_count\x18\x01 \x01(\rR\fsuccCmdCount\x12$\n" + "\x0efail_cmd_count\x18\x02 \x01(\rR\ffailCmdCount\x12+\n" + @@ -2943,7 +3071,7 @@ func file_cmd_proto_rawDescGZIP() []byte { } var file_cmd_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_cmd_proto_goTypes = []any{ (BindType)(0), // 0: saasapi.BindType (BindSourceType)(0), // 1: saasapi.BindSourceType @@ -2951,97 +3079,101 @@ var file_cmd_proto_goTypes = []any{ (CmdErrorCode)(0), // 3: saasapi.CmdErrorCode (TaskStatus)(0), // 4: saasapi.TaskStatus (*SaasReq)(nil), // 5: saasapi.SaasReq - (*Read)(nil), // 6: saasapi.Read - (*ReadItem)(nil), // 7: saasapi.ReadItem - (*Write)(nil), // 8: saasapi.Write - (*WriteItem)(nil), // 9: saasapi.WriteItem - (*Bytes)(nil), // 10: saasapi.Bytes - (*Uint32S)(nil), // 11: saasapi.Uint32s - (*FlagsWithExpire)(nil), // 12: saasapi.FlagsWithExpire - (*FlagWithExpire)(nil), // 13: saasapi.FlagWithExpire - (*ColumnWrite)(nil), // 14: saasapi.ColumnWrite - (*Task)(nil), // 15: saasapi.Task - (*TaskList)(nil), // 16: saasapi.TaskList - (*TaskRun)(nil), // 17: saasapi.TaskRun - (*TaskDelete)(nil), // 18: saasapi.TaskDelete - (*TaskInfo)(nil), // 19: saasapi.TaskInfo - (*FileInfo)(nil), // 20: saasapi.FileInfo - (*FileBlock)(nil), // 21: saasapi.FileBlock - (*TargetList)(nil), // 22: saasapi.TargetList - (*BindSet)(nil), // 23: saasapi.BindSet - (*BindDelete)(nil), // 24: saasapi.BindDelete - (*Debug)(nil), // 25: saasapi.Debug - (*SaasRes)(nil), // 26: saasapi.SaasRes - (*ReadRes)(nil), // 27: saasapi.ReadRes - (*WriteRes)(nil), // 28: saasapi.WriteRes - (*ValueItem)(nil), // 29: saasapi.ValueItem - (*TaskListRes)(nil), // 30: saasapi.TaskListRes - (*TargetListRes)(nil), // 31: saasapi.TargetListRes - (*Binds)(nil), // 32: saasapi.Binds - (*Bind)(nil), // 33: saasapi.Bind - (*BindSetRes)(nil), // 34: saasapi.BindSetRes - (*BindDeleteRes)(nil), // 35: saasapi.BindDeleteRes - (*BindError)(nil), // 36: saasapi.BindError - (*DebugRes)(nil), // 37: saasapi.DebugRes - nil, // 38: saasapi.TargetListRes.TargetListEntry + (*Info)(nil), // 6: saasapi.Info + (*Read)(nil), // 7: saasapi.Read + (*ReadItem)(nil), // 8: saasapi.ReadItem + (*Write)(nil), // 9: saasapi.Write + (*WriteItem)(nil), // 10: saasapi.WriteItem + (*Bytes)(nil), // 11: saasapi.Bytes + (*Uint32S)(nil), // 12: saasapi.Uint32s + (*FlagsWithExpire)(nil), // 13: saasapi.FlagsWithExpire + (*FlagWithExpire)(nil), // 14: saasapi.FlagWithExpire + (*ColumnWrite)(nil), // 15: saasapi.ColumnWrite + (*Task)(nil), // 16: saasapi.Task + (*TaskList)(nil), // 17: saasapi.TaskList + (*TaskRun)(nil), // 18: saasapi.TaskRun + (*TaskDelete)(nil), // 19: saasapi.TaskDelete + (*TaskInfo)(nil), // 20: saasapi.TaskInfo + (*FileInfo)(nil), // 21: saasapi.FileInfo + (*FileBlock)(nil), // 22: saasapi.FileBlock + (*TargetList)(nil), // 23: saasapi.TargetList + (*BindSet)(nil), // 24: saasapi.BindSet + (*BindDelete)(nil), // 25: saasapi.BindDelete + (*Debug)(nil), // 26: saasapi.Debug + (*SaasRes)(nil), // 27: saasapi.SaasRes + (*InfoRes)(nil), // 28: saasapi.InfoRes + (*ReadRes)(nil), // 29: saasapi.ReadRes + (*WriteRes)(nil), // 30: saasapi.WriteRes + (*ValueItem)(nil), // 31: saasapi.ValueItem + (*TaskListRes)(nil), // 32: saasapi.TaskListRes + (*TargetListRes)(nil), // 33: saasapi.TargetListRes + (*Binds)(nil), // 34: saasapi.Binds + (*Bind)(nil), // 35: saasapi.Bind + (*BindSetRes)(nil), // 36: saasapi.BindSetRes + (*BindDeleteRes)(nil), // 37: saasapi.BindDeleteRes + (*BindError)(nil), // 38: saasapi.BindError + (*DebugRes)(nil), // 39: saasapi.DebugRes + nil, // 40: saasapi.TargetListRes.TargetListEntry } var file_cmd_proto_depIdxs = []int32{ - 6, // 0: saasapi.SaasReq.read:type_name -> saasapi.Read - 8, // 1: saasapi.SaasReq.write:type_name -> saasapi.Write - 14, // 2: saasapi.SaasReq.column_write:type_name -> saasapi.ColumnWrite - 15, // 3: saasapi.SaasReq.task_create:type_name -> saasapi.Task - 16, // 4: saasapi.SaasReq.task_list:type_name -> saasapi.TaskList - 17, // 5: saasapi.SaasReq.task_run:type_name -> saasapi.TaskRun - 18, // 6: saasapi.SaasReq.task_delete:type_name -> saasapi.TaskDelete - 19, // 7: saasapi.SaasReq.task_info:type_name -> saasapi.TaskInfo - 22, // 8: saasapi.SaasReq.target_list:type_name -> saasapi.TargetList - 23, // 9: saasapi.SaasReq.bind_set:type_name -> saasapi.BindSet - 24, // 10: saasapi.SaasReq.bind_delete:type_name -> saasapi.BindDelete - 25, // 11: saasapi.SaasReq.debug:type_name -> saasapi.Debug - 7, // 12: saasapi.Read.read_items:type_name -> saasapi.ReadItem - 9, // 13: saasapi.Write.write_items:type_name -> saasapi.WriteItem - 10, // 14: saasapi.WriteItem.write_bytes:type_name -> saasapi.Bytes - 11, // 15: saasapi.WriteItem.write_uint32s:type_name -> saasapi.Uint32s - 12, // 16: saasapi.WriteItem.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire - 13, // 17: saasapi.FlagsWithExpire.flags_with_expire:type_name -> saasapi.FlagWithExpire - 10, // 18: saasapi.ColumnWrite.write_bytes:type_name -> saasapi.Bytes - 11, // 19: saasapi.ColumnWrite.write_uint32s:type_name -> saasapi.Uint32s - 12, // 20: saasapi.ColumnWrite.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire - 20, // 21: saasapi.Task.task_file_infos:type_name -> saasapi.FileInfo - 4, // 22: saasapi.Task.status:type_name -> saasapi.TaskStatus - 4, // 23: saasapi.TaskList.status_filter:type_name -> saasapi.TaskStatus - 21, // 24: saasapi.FileInfo.file_blocks:type_name -> saasapi.FileBlock - 33, // 25: saasapi.BindSet.binds:type_name -> saasapi.Bind - 33, // 26: saasapi.BindDelete.binds:type_name -> saasapi.Bind - 9, // 27: saasapi.Debug.local_did_data:type_name -> saasapi.WriteItem - 9, // 28: saasapi.Debug.local_openid_data:type_name -> saasapi.WriteItem - 2, // 29: saasapi.SaasRes.code:type_name -> saasapi.ErrorCode - 27, // 30: saasapi.SaasRes.read_res:type_name -> saasapi.ReadRes - 28, // 31: saasapi.SaasRes.write_res:type_name -> saasapi.WriteRes - 15, // 32: saasapi.SaasRes.task_create_res:type_name -> saasapi.Task - 30, // 33: saasapi.SaasRes.task_list_res:type_name -> saasapi.TaskListRes - 15, // 34: saasapi.SaasRes.task_run_res:type_name -> saasapi.Task - 15, // 35: saasapi.SaasRes.task_delete_res:type_name -> saasapi.Task - 15, // 36: saasapi.SaasRes.task_info_res:type_name -> saasapi.Task - 31, // 37: saasapi.SaasRes.target_list_res:type_name -> saasapi.TargetListRes - 34, // 38: saasapi.SaasRes.bind_set_res:type_name -> saasapi.BindSetRes - 35, // 39: saasapi.SaasRes.bind_delete_res:type_name -> saasapi.BindDeleteRes - 29, // 40: saasapi.ReadRes.cmd_res:type_name -> saasapi.ValueItem - 3, // 41: saasapi.ValueItem.cmd_code:type_name -> saasapi.CmdErrorCode - 13, // 42: saasapi.ValueItem.flags_with_expire:type_name -> saasapi.FlagWithExpire - 15, // 43: saasapi.TaskListRes.tasks:type_name -> saasapi.Task - 38, // 44: saasapi.TargetListRes.target_list:type_name -> saasapi.TargetListRes.TargetListEntry - 33, // 45: saasapi.Binds.binds:type_name -> saasapi.Bind - 0, // 46: saasapi.Bind.bind_type:type_name -> saasapi.BindType - 1, // 47: saasapi.Bind.bind_source:type_name -> saasapi.BindSourceType - 36, // 48: saasapi.BindSetRes.errors:type_name -> saasapi.BindError - 36, // 49: saasapi.BindDeleteRes.errors:type_name -> saasapi.BindError - 32, // 50: saasapi.TargetListRes.TargetListEntry.value:type_name -> saasapi.Binds - 51, // [51:51] is the sub-list for method output_type - 51, // [51:51] is the sub-list for method input_type - 51, // [51:51] is the sub-list for extension type_name - 51, // [51:51] is the sub-list for extension extendee - 0, // [0:51] is the sub-list for field type_name + 6, // 0: saasapi.SaasReq.info:type_name -> saasapi.Info + 7, // 1: saasapi.SaasReq.read:type_name -> saasapi.Read + 9, // 2: saasapi.SaasReq.write:type_name -> saasapi.Write + 15, // 3: saasapi.SaasReq.column_write:type_name -> saasapi.ColumnWrite + 16, // 4: saasapi.SaasReq.task_create:type_name -> saasapi.Task + 17, // 5: saasapi.SaasReq.task_list:type_name -> saasapi.TaskList + 18, // 6: saasapi.SaasReq.task_run:type_name -> saasapi.TaskRun + 19, // 7: saasapi.SaasReq.task_delete:type_name -> saasapi.TaskDelete + 20, // 8: saasapi.SaasReq.task_info:type_name -> saasapi.TaskInfo + 23, // 9: saasapi.SaasReq.target_list:type_name -> saasapi.TargetList + 24, // 10: saasapi.SaasReq.bind_set:type_name -> saasapi.BindSet + 25, // 11: saasapi.SaasReq.bind_delete:type_name -> saasapi.BindDelete + 26, // 12: saasapi.SaasReq.debug:type_name -> saasapi.Debug + 8, // 13: saasapi.Read.read_items:type_name -> saasapi.ReadItem + 10, // 14: saasapi.Write.write_items:type_name -> saasapi.WriteItem + 11, // 15: saasapi.WriteItem.write_bytes:type_name -> saasapi.Bytes + 12, // 16: saasapi.WriteItem.write_uint32s:type_name -> saasapi.Uint32s + 13, // 17: saasapi.WriteItem.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 14, // 18: saasapi.FlagsWithExpire.flags_with_expire:type_name -> saasapi.FlagWithExpire + 11, // 19: saasapi.ColumnWrite.write_bytes:type_name -> saasapi.Bytes + 12, // 20: saasapi.ColumnWrite.write_uint32s:type_name -> saasapi.Uint32s + 13, // 21: saasapi.ColumnWrite.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 21, // 22: saasapi.Task.task_file_infos:type_name -> saasapi.FileInfo + 4, // 23: saasapi.Task.status:type_name -> saasapi.TaskStatus + 4, // 24: saasapi.TaskList.status_filter:type_name -> saasapi.TaskStatus + 22, // 25: saasapi.FileInfo.file_blocks:type_name -> saasapi.FileBlock + 35, // 26: saasapi.BindSet.binds:type_name -> saasapi.Bind + 35, // 27: saasapi.BindDelete.binds:type_name -> saasapi.Bind + 10, // 28: saasapi.Debug.local_did_data:type_name -> saasapi.WriteItem + 10, // 29: saasapi.Debug.local_openid_data:type_name -> saasapi.WriteItem + 2, // 30: saasapi.SaasRes.code:type_name -> saasapi.ErrorCode + 28, // 31: saasapi.SaasRes.info_res:type_name -> saasapi.InfoRes + 29, // 32: saasapi.SaasRes.read_res:type_name -> saasapi.ReadRes + 30, // 33: saasapi.SaasRes.write_res:type_name -> saasapi.WriteRes + 16, // 34: saasapi.SaasRes.task_create_res:type_name -> saasapi.Task + 32, // 35: saasapi.SaasRes.task_list_res:type_name -> saasapi.TaskListRes + 16, // 36: saasapi.SaasRes.task_run_res:type_name -> saasapi.Task + 16, // 37: saasapi.SaasRes.task_delete_res:type_name -> saasapi.Task + 16, // 38: saasapi.SaasRes.task_info_res:type_name -> saasapi.Task + 33, // 39: saasapi.SaasRes.target_list_res:type_name -> saasapi.TargetListRes + 36, // 40: saasapi.SaasRes.bind_set_res:type_name -> saasapi.BindSetRes + 37, // 41: saasapi.SaasRes.bind_delete_res:type_name -> saasapi.BindDeleteRes + 31, // 42: saasapi.ReadRes.cmd_res:type_name -> saasapi.ValueItem + 3, // 43: saasapi.ValueItem.cmd_code:type_name -> saasapi.CmdErrorCode + 14, // 44: saasapi.ValueItem.flags_with_expire:type_name -> saasapi.FlagWithExpire + 16, // 45: saasapi.TaskListRes.tasks:type_name -> saasapi.Task + 40, // 46: saasapi.TargetListRes.target_list:type_name -> saasapi.TargetListRes.TargetListEntry + 35, // 47: saasapi.Binds.binds:type_name -> saasapi.Bind + 0, // 48: saasapi.Bind.bind_type:type_name -> saasapi.BindType + 1, // 49: saasapi.Bind.bind_source:type_name -> saasapi.BindSourceType + 38, // 50: saasapi.BindSetRes.errors:type_name -> saasapi.BindError + 38, // 51: saasapi.BindDeleteRes.errors:type_name -> saasapi.BindError + 34, // 52: saasapi.TargetListRes.TargetListEntry.value:type_name -> saasapi.Binds + 53, // [53:53] is the sub-list for method output_type + 53, // [53:53] is the sub-list for method input_type + 53, // [53:53] is the sub-list for extension type_name + 53, // [53:53] is the sub-list for extension extendee + 0, // [0:53] is the sub-list for field type_name } func init() { file_cmd_proto_init() } @@ -3050,6 +3182,7 @@ func file_cmd_proto_init() { return } file_cmd_proto_msgTypes[0].OneofWrappers = []any{ + (*SaasReq_Info)(nil), (*SaasReq_Read)(nil), (*SaasReq_Write)(nil), (*SaasReq_ColumnWrite)(nil), @@ -3063,7 +3196,8 @@ func file_cmd_proto_init() { (*SaasReq_BindDelete)(nil), (*SaasReq_Debug)(nil), } - file_cmd_proto_msgTypes[21].OneofWrappers = []any{ + file_cmd_proto_msgTypes[22].OneofWrappers = []any{ + (*SaasRes_InfoRes)(nil), (*SaasRes_ReadRes)(nil), (*SaasRes_WriteRes)(nil), (*SaasRes_TaskCreateRes)(nil), @@ -3081,7 +3215,7 @@ func file_cmd_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_proto_rawDesc), len(file_cmd_proto_rawDesc)), NumEnums: 5, - NumMessages: 34, + NumMessages: 36, NumExtensions: 0, NumServices: 0, }, diff --git a/cmd.proto b/cmd.proto index 9570806..be71a51 100644 --- a/cmd.proto +++ b/cmd.proto @@ -7,6 +7,8 @@ option go_package = "e.coding.net/rta/public/saasapi"; // SaasReq 命令请求 message SaasReq { oneof cmd { + Info info = 5; // 获取账号设置 + Read read = 10; // 批量读取 Write write = 11; // 批量写入 ColumnWrite column_write = 12; // 全量列式写入 @@ -26,6 +28,11 @@ message SaasReq { } } +// Info 获取账号信息 +message Info { + +} + // Read 批量读取命令 message Read { string dataspace_id = 1; // 数据空间ID @@ -174,6 +181,8 @@ message SaasRes { ErrorCode code = 1; // 返回码 string status = 2; // 返回信息的文本提示 oneof res { + InfoRes info_res = 5; // 账号信息返回 + ReadRes read_res = 10; // 读取命令返回 WriteRes write_res = 11; // 写入命令返回 @@ -190,6 +199,13 @@ message SaasRes { } } +// InfoRes 账号信息返回 +message InfoRes { + repeated string dataspace_id = 1; // 可用数据区 + repeated string target_id = 2; // 策略ID + +} + // ReadRes 读记录返回 message ReadRes { uint32 succ_cmd_count = 1; // 成功的命令数量 diff --git a/cmd/saastool/help.go b/cmd/saastool/help.go index 5985e42..d705499 100644 --- a/cmd/saastool/help.go +++ b/cmd/saastool/help.go @@ -15,6 +15,7 @@ const usage = ` Usage: saastool COMMAND [OPTIONS] Commands: + info Saas Info write Write user's 'bytes / uint32s / flags' read Read user's 'bytes / uint32s / flags' columnwrite Write columns for 'deviceid / openid' users diff --git a/cmd/saastool/info.go b/cmd/saastool/info.go new file mode 100644 index 0000000..320fc6c --- /dev/null +++ b/cmd/saastool/info.go @@ -0,0 +1,71 @@ +package main + +import ( + "flag" + "fmt" + "net/http" + "os" + + "e.coding.net/rta/public/saasapi" + "e.coding.net/rta/public/saasapi/pkg/saashttp" + "google.golang.org/protobuf/encoding/protojson" +) + +type infoParams struct { + saasHttp *saashttp.SaasClient +} + +func RunInfo(args ...string) error { + fs := flag.NewFlagSet("info", flag.ExitOnError) + cfgFile := paramConfig(fs) + + if err := fs.Parse(args); err != nil { + fmt.Fprintln(os.Stderr, "command line parse error", "err", err) + return err + } + + if fs.NArg() > 0 { + fs.PrintDefaults() + return nil + } + + cfg, err := LoadConfigFile(*cfgFile) + if err != nil { + fmt.Fprintln(os.Stderr, "LoadConfigFile error", "err", err) + return err + } + + infoParams := infoParams{ + saasHttp: &saashttp.SaasClient{ + Client: &http.Client{}, + ApiUrls: saashttp.InitAPIUrl(&cfg.ApiUrls), + Auth: &cfg.Auth, + }, + } + return doInfo(infoParams) +} + +func doInfo(infoParams infoParams) error { + saasReq := &saasapi.SaasReq{ + Cmd: &saasapi.SaasReq_Info{ + Info: &saasapi.Info{}, + }, + } + + res, err := infoParams.saasHttp.Info(saasReq) + + if err != nil { + fmt.Fprintln(os.Stderr, "submit Info error", "err", err) + return err + } + + if res.Code != saasapi.ErrorCode_SUCC { + fmt.Fprintln(os.Stderr, "info failed", "code", res.Code, "status", res.Status) + return nil + } + + infoRes := res.GetInfoRes() + + fmt.Printf("info res: %v\n", protojson.Format(infoRes)) + return nil +} diff --git a/cmd/saastool/main.go b/cmd/saastool/main.go index 43e8ef8..f976e6d 100644 --- a/cmd/saastool/main.go +++ b/cmd/saastool/main.go @@ -18,6 +18,8 @@ func Run(args ...string) error { switch name { case "", "help": return RunHelp(args...) + case "info": + return RunInfo(args...) case "write": return RunWrite(args...) case "read": diff --git a/pkg/saashttp/cfg.go b/pkg/saashttp/cfg.go index 98b211d..5dcf72f 100644 --- a/pkg/saashttp/cfg.go +++ b/pkg/saashttp/cfg.go @@ -2,6 +2,7 @@ package saashttp const ( baseUrl = "https://api.rta.qq.com" + infoPath = "/saas/info" writePath = "/saas/write" readPath = "/saas/read" columnWritePath = "/saas/column_write" @@ -20,6 +21,7 @@ const ( type ApiUrls struct { BaseUrl string + InfoPath string WritePath string ReadPath string ColumnWritePath string @@ -43,6 +45,12 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls { r.BaseUrl = baseUrl } + if c.InfoPath != "" { + r.InfoPath = c.InfoPath + } else { + r.InfoPath = infoPath + } + if c.WritePath != "" { r.WritePath = c.WritePath } else { diff --git a/pkg/saashttp/httpcli.go b/pkg/saashttp/httpcli.go index f401bcc..1cce76d 100644 --- a/pkg/saashttp/httpcli.go +++ b/pkg/saashttp/httpcli.go @@ -33,6 +33,11 @@ type SaasClient struct { ResponseEncoder ResponseEncoder } +func (c *SaasClient) Info(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) { + postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.InfoPath) + return c.post(postUrl, saasReq) +} + func (c *SaasClient) Write(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) { postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.WritePath) return c.post(postUrl, saasReq)