From 095a0b9b019c0226ad6f37c130d9d8b2724c27cb Mon Sep 17 00:00:00 2001 From: algotao Date: Sat, 30 Aug 2025 14:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd.pb.go | 611 +++++++++++++++++++++++++++---------------- cmd.proto | 58 ++-- cmd/saastool/bind.go | 2 +- 3 files changed, 429 insertions(+), 242 deletions(-) diff --git a/cmd.pb.go b/cmd.pb.go index 3cffd30..9c1fbce 100644 --- a/cmd.pb.go +++ b/cmd.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.8 // protoc v5.29.4 // source: cmd.proto @@ -350,6 +350,55 @@ func (TaskStatus) EnumDescriptor() ([]byte, []int) { return file_cmd_proto_rawDescGZIP(), []int{4} } +type OS int32 + +const ( + OS_UNKNOWN OS = 0 + OS_IOS OS = 1 + OS_ANDROID OS = 2 +) + +// Enum value maps for OS. +var ( + OS_name = map[int32]string{ + 0: "UNKNOWN", + 1: "IOS", + 2: "ANDROID", + } + OS_value = map[string]int32{ + "UNKNOWN": 0, + "IOS": 1, + "ANDROID": 2, + } +) + +func (x OS) Enum() *OS { + p := new(OS) + *p = x + return p +} + +func (x OS) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OS) Descriptor() protoreflect.EnumDescriptor { + return file_cmd_proto_enumTypes[5].Descriptor() +} + +func (OS) Type() protoreflect.EnumType { + return &file_cmd_proto_enumTypes[5] +} + +func (x OS) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OS.Descriptor instead. +func (OS) EnumDescriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{5} +} + // SaasReq 命令请求 type SaasReq struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -367,7 +416,8 @@ type SaasReq struct { // *SaasReq_TargetList // *SaasReq_BindSet // *SaasReq_BindDelete - // *SaasReq_Debug + // *SaasReq_ScriptRun + // *SaasReq_ScriptUpdate Cmd isSaasReq_Cmd `protobuf_oneof:"cmd"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -518,10 +568,19 @@ func (x *SaasReq) GetBindDelete() *BindDelete { return nil } -func (x *SaasReq) GetDebug() *Debug { +func (x *SaasReq) GetScriptRun() *ScriptRun { if x != nil { - if x, ok := x.Cmd.(*SaasReq_Debug); ok { - return x.Debug + if x, ok := x.Cmd.(*SaasReq_ScriptRun); ok { + return x.ScriptRun + } + } + return nil +} + +func (x *SaasReq) GetScriptUpdate() *ScriptUpdate { + if x != nil { + if x, ok := x.Cmd.(*SaasReq_ScriptUpdate); ok { + return x.ScriptUpdate } } return nil @@ -579,8 +638,12 @@ type SaasReq_BindDelete struct { BindDelete *BindDelete `protobuf:"bytes,62,opt,name=bind_delete,json=bindDelete,proto3,oneof"` // 解除绑定 } -type SaasReq_Debug struct { - Debug *Debug `protobuf:"bytes,90,opt,name=debug,proto3,oneof"` // 试运行lua脚本 +type SaasReq_ScriptRun struct { + ScriptRun *ScriptRun `protobuf:"bytes,90,opt,name=script_run,json=scriptRun,proto3,oneof"` // 运行脚本 +} + +type SaasReq_ScriptUpdate struct { + ScriptUpdate *ScriptUpdate `protobuf:"bytes,91,opt,name=script_update,json=scriptUpdate,proto3,oneof"` // 脚本升级 } func (*SaasReq_Info) isSaasReq_Cmd() {} @@ -607,7 +670,9 @@ func (*SaasReq_BindSet) isSaasReq_Cmd() {} func (*SaasReq_BindDelete) isSaasReq_Cmd() {} -func (*SaasReq_Debug) isSaasReq_Cmd() {} +func (*SaasReq_ScriptRun) isSaasReq_Cmd() {} + +func (*SaasReq_ScriptUpdate) isSaasReq_Cmd() {} // Info 获取账号信息 type Info struct { @@ -1773,34 +1838,32 @@ func (x *BindDelete) GetBinds() []*Bind { return nil } -// Debug 调试 -type Debug struct { - state protoimpl.MessageState `protogen:"open.v1"` - LuaScript string `protobuf:"bytes,1,opt,name=lua_script,json=luaScript,proto3" json:"lua_script,omitempty"` // 要调试的lua脚本 - UseServerData bool `protobuf:"varint,2,opt,name=use_server_data,json=useServerData,proto3" json:"use_server_data,omitempty"` // 是否使用服务端用户数据 - ServerDid string `protobuf:"bytes,3,opt,name=server_did,json=serverDid,proto3" json:"server_did,omitempty"` // 将从服务端读取该DID下的数据 - Appid string `protobuf:"bytes,4,opt,name=appid,proto3" json:"appid,omitempty"` // 小程序/小游戏/公众号/视频号的appid - ServerOpenid string `protobuf:"bytes,5,opt,name=server_openid,json=serverOpenid,proto3" json:"server_openid,omitempty"` // 将从服务端读取该openid下的数据,需与appid配对使用 - LocalDidData *WriteItem `protobuf:"bytes,6,opt,name=local_did_data,json=localDidData,proto3" json:"local_did_data,omitempty"` // 客户自定义DID用户数据 - LocalOpenidData *WriteItem `protobuf:"bytes,7,opt,name=local_openid_data,json=localOpenidData,proto3" json:"local_openid_data,omitempty"` // 客户定定义OpenID用户数据 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +// ScriptRun 运行脚本 +type ScriptRun struct { + state protoimpl.MessageState `protogen:"open.v1"` + LuaScript string `protobuf:"bytes,1,opt,name=lua_script,json=luaScript,proto3" json:"lua_script,omitempty"` // 要调试的lua脚本 + ServerDid string `protobuf:"bytes,2,opt,name=server_did,json=serverDid,proto3" json:"server_did,omitempty"` // 将从服务端读取该DID下的数据 + Appid string `protobuf:"bytes,3,opt,name=appid,proto3" json:"appid,omitempty"` // 小程序/小游戏/公众号/视频号的appid + ServerOpenid string `protobuf:"bytes,4,opt,name=server_openid,json=serverOpenid,proto3" json:"server_openid,omitempty"` // 将从服务端读取该openid下的数据,需与appid配对使用 + Os OS `protobuf:"varint,5,opt,name=os,proto3,enum=saasapi.OS" json:"os,omitempty"` // 操作系统 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x *Debug) Reset() { - *x = Debug{} +func (x *ScriptRun) Reset() { + *x = ScriptRun{} mi := &file_cmd_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Debug) String() string { +func (x *ScriptRun) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Debug) ProtoMessage() {} +func (*ScriptRun) ProtoMessage() {} -func (x *Debug) ProtoReflect() protoreflect.Message { +func (x *ScriptRun) ProtoReflect() protoreflect.Message { mi := &file_cmd_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1812,58 +1875,81 @@ func (x *Debug) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Debug.ProtoReflect.Descriptor instead. -func (*Debug) Descriptor() ([]byte, []int) { +// Deprecated: Use ScriptRun.ProtoReflect.Descriptor instead. +func (*ScriptRun) Descriptor() ([]byte, []int) { return file_cmd_proto_rawDescGZIP(), []int{21} } -func (x *Debug) GetLuaScript() string { +func (x *ScriptRun) GetLuaScript() string { if x != nil { return x.LuaScript } return "" } -func (x *Debug) GetUseServerData() bool { - if x != nil { - return x.UseServerData - } - return false -} - -func (x *Debug) GetServerDid() string { +func (x *ScriptRun) GetServerDid() string { if x != nil { return x.ServerDid } return "" } -func (x *Debug) GetAppid() string { +func (x *ScriptRun) GetAppid() string { if x != nil { return x.Appid } return "" } -func (x *Debug) GetServerOpenid() string { +func (x *ScriptRun) GetServerOpenid() string { if x != nil { return x.ServerOpenid } return "" } -func (x *Debug) GetLocalDidData() *WriteItem { +func (x *ScriptRun) GetOs() OS { if x != nil { - return x.LocalDidData + return x.Os } - return nil + return OS_UNKNOWN } -func (x *Debug) GetLocalOpenidData() *WriteItem { +// ScriptUpdate 升级脚本 +type ScriptUpdate struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScriptUpdate) Reset() { + *x = ScriptUpdate{} + mi := &file_cmd_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScriptUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScriptUpdate) ProtoMessage() {} + +func (x *ScriptUpdate) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[22] if x != nil { - return x.LocalOpenidData + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) +} + +// Deprecated: Use ScriptUpdate.ProtoReflect.Descriptor instead. +func (*ScriptUpdate) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{22} } // SaasRes 命令返回 @@ -1884,6 +1970,8 @@ type SaasRes struct { // *SaasRes_TargetListRes // *SaasRes_BindSetRes // *SaasRes_BindDeleteRes + // *SaasRes_ScriptRunRes + // *SaasRes_ScriptUpdateRes Res isSaasRes_Res `protobuf_oneof:"res"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1891,7 +1979,7 @@ type SaasRes struct { func (x *SaasRes) Reset() { *x = SaasRes{} - mi := &file_cmd_proto_msgTypes[22] + mi := &file_cmd_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1903,7 +1991,7 @@ func (x *SaasRes) String() string { func (*SaasRes) ProtoMessage() {} func (x *SaasRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[22] + mi := &file_cmd_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1916,7 +2004,7 @@ func (x *SaasRes) ProtoReflect() protoreflect.Message { // Deprecated: Use SaasRes.ProtoReflect.Descriptor instead. func (*SaasRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{22} + return file_cmd_proto_rawDescGZIP(), []int{23} } func (x *SaasRes) GetCode() ErrorCode { @@ -2039,6 +2127,24 @@ func (x *SaasRes) GetBindDeleteRes() *BindDeleteRes { return nil } +func (x *SaasRes) GetScriptRunRes() *ScriptRunRes { + if x != nil { + if x, ok := x.Res.(*SaasRes_ScriptRunRes); ok { + return x.ScriptRunRes + } + } + return nil +} + +func (x *SaasRes) GetScriptUpdateRes() *ScriptUpdateRes { + if x != nil { + if x, ok := x.Res.(*SaasRes_ScriptUpdateRes); ok { + return x.ScriptUpdateRes + } + } + return nil +} + type isSaasRes_Res interface { isSaasRes_Res() } @@ -2087,6 +2193,14 @@ type SaasRes_BindDeleteRes struct { BindDeleteRes *BindDeleteRes `protobuf:"bytes,62,opt,name=bind_delete_res,json=bindDeleteRes,proto3,oneof"` // 删除绑定返回状态 } +type SaasRes_ScriptRunRes struct { + ScriptRunRes *ScriptRunRes `protobuf:"bytes,90,opt,name=script_run_res,json=scriptRunRes,proto3,oneof"` // 运行脚本返回 +} + +type SaasRes_ScriptUpdateRes struct { + ScriptUpdateRes *ScriptUpdateRes `protobuf:"bytes,91,opt,name=script_update_res,json=scriptUpdateRes,proto3,oneof"` // 升级脚本返回 +} + func (*SaasRes_InfoRes) isSaasRes_Res() {} func (*SaasRes_ReadRes) isSaasRes_Res() {} @@ -2109,18 +2223,22 @@ func (*SaasRes_BindSetRes) isSaasRes_Res() {} func (*SaasRes_BindDeleteRes) isSaasRes_Res() {} +func (*SaasRes_ScriptRunRes) isSaasRes_Res() {} + +func (*SaasRes_ScriptUpdateRes) 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 + 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] + mi := &file_cmd_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2132,7 +2250,7 @@ func (x *InfoRes) String() string { func (*InfoRes) ProtoMessage() {} func (x *InfoRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[23] + mi := &file_cmd_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2145,7 +2263,7 @@ func (x *InfoRes) ProtoReflect() protoreflect.Message { // Deprecated: Use InfoRes.ProtoReflect.Descriptor instead. func (*InfoRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{23} + return file_cmd_proto_rawDescGZIP(), []int{24} } func (x *InfoRes) GetDataspaceId() []string { @@ -2174,7 +2292,7 @@ type ReadRes struct { func (x *ReadRes) Reset() { *x = ReadRes{} - mi := &file_cmd_proto_msgTypes[24] + mi := &file_cmd_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2186,7 +2304,7 @@ func (x *ReadRes) String() string { func (*ReadRes) ProtoMessage() {} func (x *ReadRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[24] + mi := &file_cmd_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2199,7 +2317,7 @@ func (x *ReadRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadRes.ProtoReflect.Descriptor instead. func (*ReadRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{24} + return file_cmd_proto_rawDescGZIP(), []int{25} } func (x *ReadRes) GetSuccCmdCount() uint32 { @@ -2226,8 +2344,8 @@ func (x *ReadRes) GetCmdRes() []*ValueItem { // WriteRes 写记录返回 type WriteRes struct { state protoimpl.MessageState `protogen:"open.v1"` - // uint32 succ_cmd_count = 1; // 成功的命令数量 - // uint32 fail_cmd_count = 2; // 失败的命令数量 + // uint32 succ_cmd_count = 1; // 成功的命令数量 + // uint32 fail_cmd_count = 2; // 失败的命令数量 FailedUserid []string `protobuf:"bytes,3,rep,name=failed_userid,json=failedUserid,proto3" json:"failed_userid,omitempty"` // 返回的失败的用户ID unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2235,7 +2353,7 @@ type WriteRes struct { func (x *WriteRes) Reset() { *x = WriteRes{} - mi := &file_cmd_proto_msgTypes[25] + mi := &file_cmd_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2247,7 +2365,7 @@ func (x *WriteRes) String() string { func (*WriteRes) ProtoMessage() {} func (x *WriteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[25] + mi := &file_cmd_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2260,7 +2378,7 @@ func (x *WriteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteRes.ProtoReflect.Descriptor instead. func (*WriteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{25} + return file_cmd_proto_rawDescGZIP(), []int{26} } func (x *WriteRes) GetFailedUserid() []string { @@ -2285,7 +2403,7 @@ type ValueItem struct { func (x *ValueItem) Reset() { *x = ValueItem{} - mi := &file_cmd_proto_msgTypes[26] + mi := &file_cmd_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2297,7 +2415,7 @@ func (x *ValueItem) String() string { func (*ValueItem) ProtoMessage() {} func (x *ValueItem) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[26] + mi := &file_cmd_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2310,7 +2428,7 @@ func (x *ValueItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ValueItem.ProtoReflect.Descriptor instead. func (*ValueItem) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{26} + return file_cmd_proto_rawDescGZIP(), []int{27} } func (x *ValueItem) GetCmdIndex() uint32 { @@ -2365,7 +2483,7 @@ type TaskListRes struct { func (x *TaskListRes) Reset() { *x = TaskListRes{} - mi := &file_cmd_proto_msgTypes[27] + mi := &file_cmd_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2377,7 +2495,7 @@ func (x *TaskListRes) String() string { func (*TaskListRes) ProtoMessage() {} func (x *TaskListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[27] + mi := &file_cmd_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2390,7 +2508,7 @@ func (x *TaskListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskListRes.ProtoReflect.Descriptor instead. func (*TaskListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{27} + return file_cmd_proto_rawDescGZIP(), []int{28} } func (x *TaskListRes) GetTasks() []*Task { @@ -2410,7 +2528,7 @@ type TargetListRes struct { func (x *TargetListRes) Reset() { *x = TargetListRes{} - mi := &file_cmd_proto_msgTypes[28] + mi := &file_cmd_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2422,7 +2540,7 @@ func (x *TargetListRes) String() string { func (*TargetListRes) ProtoMessage() {} func (x *TargetListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[28] + mi := &file_cmd_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2435,7 +2553,7 @@ func (x *TargetListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetListRes.ProtoReflect.Descriptor instead. func (*TargetListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{28} + return file_cmd_proto_rawDescGZIP(), []int{29} } func (x *TargetListRes) GetTargetList() map[string]*Binds { @@ -2454,7 +2572,7 @@ type Binds struct { func (x *Binds) Reset() { *x = Binds{} - mi := &file_cmd_proto_msgTypes[29] + mi := &file_cmd_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2466,7 +2584,7 @@ func (x *Binds) String() string { func (*Binds) ProtoMessage() {} func (x *Binds) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[29] + mi := &file_cmd_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2479,7 +2597,7 @@ func (x *Binds) ProtoReflect() protoreflect.Message { // Deprecated: Use Binds.ProtoReflect.Descriptor instead. func (*Binds) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{29} + return file_cmd_proto_rawDescGZIP(), []int{30} } func (x *Binds) GetBinds() []*Bind { @@ -2503,7 +2621,7 @@ type Bind struct { func (x *Bind) Reset() { *x = Bind{} - mi := &file_cmd_proto_msgTypes[30] + mi := &file_cmd_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2515,7 +2633,7 @@ func (x *Bind) String() string { func (*Bind) ProtoMessage() {} func (x *Bind) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[30] + mi := &file_cmd_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2528,7 +2646,7 @@ func (x *Bind) ProtoReflect() protoreflect.Message { // Deprecated: Use Bind.ProtoReflect.Descriptor instead. func (*Bind) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{30} + return file_cmd_proto_rawDescGZIP(), []int{31} } func (x *Bind) GetBindId() int64 { @@ -2578,7 +2696,7 @@ type BindSetRes struct { func (x *BindSetRes) Reset() { *x = BindSetRes{} - mi := &file_cmd_proto_msgTypes[31] + mi := &file_cmd_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2590,7 +2708,7 @@ func (x *BindSetRes) String() string { func (*BindSetRes) ProtoMessage() {} func (x *BindSetRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[31] + mi := &file_cmd_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2603,7 +2721,7 @@ func (x *BindSetRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindSetRes.ProtoReflect.Descriptor instead. func (*BindSetRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{31} + return file_cmd_proto_rawDescGZIP(), []int{32} } func (x *BindSetRes) GetSuccessNum() int32 { @@ -2639,7 +2757,7 @@ type BindDeleteRes struct { func (x *BindDeleteRes) Reset() { *x = BindDeleteRes{} - mi := &file_cmd_proto_msgTypes[32] + mi := &file_cmd_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2651,7 +2769,7 @@ func (x *BindDeleteRes) String() string { func (*BindDeleteRes) ProtoMessage() {} func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[32] + mi := &file_cmd_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2664,7 +2782,7 @@ func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindDeleteRes.ProtoReflect.Descriptor instead. func (*BindDeleteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{32} + return file_cmd_proto_rawDescGZIP(), []int{33} } func (x *BindDeleteRes) GetSuccessNum() int32 { @@ -2700,7 +2818,7 @@ type BindError struct { func (x *BindError) Reset() { *x = BindError{} - mi := &file_cmd_proto_msgTypes[33] + mi := &file_cmd_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2712,7 +2830,7 @@ func (x *BindError) String() string { func (*BindError) ProtoMessage() {} func (x *BindError) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[33] + mi := &file_cmd_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2725,7 +2843,7 @@ func (x *BindError) ProtoReflect() protoreflect.Message { // Deprecated: Use BindError.ProtoReflect.Descriptor instead. func (*BindError) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{33} + return file_cmd_proto_rawDescGZIP(), []int{34} } func (x *BindError) GetBindId() int64 { @@ -2749,31 +2867,31 @@ func (x *BindError) GetReason() string { return "" } -// DebugRes 调试返回 -type DebugRes struct { +// ScriptRunRes 运行脚本返回 +type ScriptRunRes struct { state protoimpl.MessageState `protogen:"open.v1"` - PrintOutput string `protobuf:"bytes,1,opt,name=PrintOutput,proto3" json:"PrintOutput,omitempty"` // print输出 - Error string `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"` // 错误信息 - TargetsOutput string `protobuf:"bytes,3,opt,name=TargetsOutput,proto3" json:"TargetsOutput,omitempty"` // 策略输出 + PrintOutput string `protobuf:"bytes,1,opt,name=print_output,json=printOutput,proto3" json:"print_output,omitempty"` // print输出 + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 错误信息 + TargetsOutput string `protobuf:"bytes,3,opt,name=targets_output,json=targetsOutput,proto3" json:"targets_output,omitempty"` // 策略输出 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *DebugRes) Reset() { - *x = DebugRes{} - mi := &file_cmd_proto_msgTypes[34] +func (x *ScriptRunRes) Reset() { + *x = ScriptRunRes{} + mi := &file_cmd_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *DebugRes) String() string { +func (x *ScriptRunRes) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DebugRes) ProtoMessage() {} +func (*ScriptRunRes) ProtoMessage() {} -func (x *DebugRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[34] +func (x *ScriptRunRes) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2784,37 +2902,74 @@ func (x *DebugRes) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DebugRes.ProtoReflect.Descriptor instead. -func (*DebugRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{34} +// Deprecated: Use ScriptRunRes.ProtoReflect.Descriptor instead. +func (*ScriptRunRes) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{35} } -func (x *DebugRes) GetPrintOutput() string { +func (x *ScriptRunRes) GetPrintOutput() string { if x != nil { return x.PrintOutput } return "" } -func (x *DebugRes) GetError() string { +func (x *ScriptRunRes) GetError() string { if x != nil { return x.Error } return "" } -func (x *DebugRes) GetTargetsOutput() string { +func (x *ScriptRunRes) GetTargetsOutput() string { if x != nil { return x.TargetsOutput } return "" } +// ScriptUpdateRes 升级脚本返回 +type ScriptUpdateRes struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScriptUpdateRes) Reset() { + *x = ScriptUpdateRes{} + mi := &file_cmd_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScriptUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScriptUpdateRes) ProtoMessage() {} + +func (x *ScriptUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[36] + 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 ScriptUpdateRes.ProtoReflect.Descriptor instead. +func (*ScriptUpdateRes) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{36} +} + var File_cmd_proto protoreflect.FileDescriptor const file_cmd_proto_rawDesc = "" + "\n" + - "\tcmd.proto\x12\asaasapi\"\x81\x05\n" + + "\tcmd.proto\x12\asaasapi\"\xcc\x05\n" + "\aSaasReq\x12#\n" + "\x04info\x18\x05 \x01(\v2\r.saasapi.InfoH\x00R\x04info\x12#\n" + "\x04read\x18\n" + @@ -2832,8 +2987,10 @@ const file_cmd_proto_rawDesc = "" + "targetList\x12-\n" + "\bbind_set\x18= \x01(\v2\x10.saasapi.BindSetH\x00R\abindSet\x126\n" + "\vbind_delete\x18> \x01(\v2\x13.saasapi.BindDeleteH\x00R\n" + - "bindDelete\x12&\n" + - "\x05debug\x18Z \x01(\v2\x0e.saasapi.DebugH\x00R\x05debugB\x05\n" + + "bindDelete\x123\n" + + "\n" + + "script_run\x18Z \x01(\v2\x12.saasapi.ScriptRunH\x00R\tscriptRun\x12<\n" + + "\rscript_update\x18[ \x01(\v2\x15.saasapi.ScriptUpdateH\x00R\fscriptUpdateB\x05\n" + "\x03cmd\"\x06\n" + "\x04Info\"q\n" + "\x04Read\x12!\n" + @@ -2923,17 +3080,16 @@ const file_cmd_proto_rawDesc = "" + "\x05binds\x18\x02 \x03(\v2\r.saasapi.BindR\x05binds\"1\n" + "\n" + "BindDelete\x12#\n" + - "\x05binds\x18\x02 \x03(\v2\r.saasapi.BindR\x05binds\"\xa2\x02\n" + - "\x05Debug\x12\x1d\n" + + "\x05binds\x18\x02 \x03(\v2\r.saasapi.BindR\x05binds\"\xa1\x01\n" + + "\tScriptRun\x12\x1d\n" + "\n" + - "lua_script\x18\x01 \x01(\tR\tluaScript\x12&\n" + - "\x0fuse_server_data\x18\x02 \x01(\bR\ruseServerData\x12\x1d\n" + + "lua_script\x18\x01 \x01(\tR\tluaScript\x12\x1d\n" + "\n" + - "server_did\x18\x03 \x01(\tR\tserverDid\x12\x14\n" + - "\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\"\xb3\x05\n" + + "server_did\x18\x02 \x01(\tR\tserverDid\x12\x14\n" + + "\x05appid\x18\x03 \x01(\tR\x05appid\x12#\n" + + "\rserver_openid\x18\x04 \x01(\tR\fserverOpenid\x12\x1b\n" + + "\x02os\x18\x05 \x01(\x0e2\v.saasapi.OSR\x02os\"\x0e\n" + + "\fScriptUpdate\"\xba\x06\n" + "\aSaasRes\x12&\n" + "\x04code\x18\x01 \x01(\x0e2\x12.saasapi.ErrorCodeR\x04code\x12\x16\n" + "\x06status\x18\x02 \x01(\tR\x06status\x12-\n" + @@ -2950,7 +3106,9 @@ const file_cmd_proto_rawDesc = "" + "\x0ftarget_list_res\x182 \x01(\v2\x16.saasapi.TargetListResH\x00R\rtargetListRes\x127\n" + "\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" + + "\x0fbind_delete_res\x18> \x01(\v2\x16.saasapi.BindDeleteResH\x00R\rbindDeleteRes\x12=\n" + + "\x0escript_run_res\x18Z \x01(\v2\x15.saasapi.ScriptRunResH\x00R\fscriptRunRes\x12F\n" + + "\x11script_update_res\x18[ \x01(\v2\x18.saasapi.ScriptUpdateResH\x00R\x0fscriptUpdateResB\x05\n" + "\x03res\"I\n" + "\aInfoRes\x12!\n" + "\fdataspace_id\x18\x01 \x03(\tR\vdataspaceId\x12\x1b\n" + @@ -3000,11 +3158,12 @@ const file_cmd_proto_rawDesc = "" + "\tBindError\x12\x17\n" + "\abind_id\x18\x01 \x01(\x03R\x06bindId\x12\x1b\n" + "\tbind_type\x18\x02 \x01(\x05R\bbindType\x12\x16\n" + - "\x06reason\x18\x03 \x01(\tR\x06reason\"h\n" + - "\bDebugRes\x12 \n" + - "\vPrintOutput\x18\x01 \x01(\tR\vPrintOutput\x12\x14\n" + - "\x05Error\x18\x02 \x01(\tR\x05Error\x12$\n" + - "\rTargetsOutput\x18\x03 \x01(\tR\rTargetsOutput*=\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"n\n" + + "\fScriptRunRes\x12!\n" + + "\fprint_output\x18\x01 \x01(\tR\vprintOutput\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12%\n" + + "\x0etargets_output\x18\x03 \x01(\tR\rtargetsOutput\"\x11\n" + + "\x0fScriptUpdateRes*=\n" + "\bBindType\x12\x13\n" + "\x0fUnknownBindType\x10\x00\x12\r\n" + "\tAdgroupId\x10\x01\x12\r\n" + @@ -3056,7 +3215,11 @@ const file_cmd_proto_rawDesc = "" + "\aSUCCESS\x10\x04\x12\b\n" + "\x04FAIL\x10\x05\x12\v\n" + "\aDELETED\x10\n" + - "B!Z\x1fe.coding.net/rta/public/saasapib\x06proto3" + "*'\n" + + "\x02OS\x12\v\n" + + "\aUNKNOWN\x10\x00\x12\a\n" + + "\x03IOS\x10\x01\x12\v\n" + + "\aANDROID\x10\x02B!Z\x1fe.coding.net/rta/public/saasapib\x06proto3" var ( file_cmd_proto_rawDescOnce sync.Once @@ -3070,110 +3233,115 @@ func file_cmd_proto_rawDescGZIP() []byte { return file_cmd_proto_rawDescData } -var file_cmd_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 36) +var file_cmd_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 38) var file_cmd_proto_goTypes = []any{ (BindType)(0), // 0: saasapi.BindType (BindSourceType)(0), // 1: saasapi.BindSourceType (ErrorCode)(0), // 2: saasapi.ErrorCode (CmdErrorCode)(0), // 3: saasapi.CmdErrorCode (TaskStatus)(0), // 4: saasapi.TaskStatus - (*SaasReq)(nil), // 5: saasapi.SaasReq - (*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 + (OS)(0), // 5: saasapi.OS + (*SaasReq)(nil), // 6: saasapi.SaasReq + (*Info)(nil), // 7: saasapi.Info + (*Read)(nil), // 8: saasapi.Read + (*ReadItem)(nil), // 9: saasapi.ReadItem + (*Write)(nil), // 10: saasapi.Write + (*WriteItem)(nil), // 11: saasapi.WriteItem + (*Bytes)(nil), // 12: saasapi.Bytes + (*Uint32S)(nil), // 13: saasapi.Uint32s + (*FlagsWithExpire)(nil), // 14: saasapi.FlagsWithExpire + (*FlagWithExpire)(nil), // 15: saasapi.FlagWithExpire + (*ColumnWrite)(nil), // 16: saasapi.ColumnWrite + (*Task)(nil), // 17: saasapi.Task + (*TaskList)(nil), // 18: saasapi.TaskList + (*TaskRun)(nil), // 19: saasapi.TaskRun + (*TaskDelete)(nil), // 20: saasapi.TaskDelete + (*TaskInfo)(nil), // 21: saasapi.TaskInfo + (*FileInfo)(nil), // 22: saasapi.FileInfo + (*FileBlock)(nil), // 23: saasapi.FileBlock + (*TargetList)(nil), // 24: saasapi.TargetList + (*BindSet)(nil), // 25: saasapi.BindSet + (*BindDelete)(nil), // 26: saasapi.BindDelete + (*ScriptRun)(nil), // 27: saasapi.ScriptRun + (*ScriptUpdate)(nil), // 28: saasapi.ScriptUpdate + (*SaasRes)(nil), // 29: saasapi.SaasRes + (*InfoRes)(nil), // 30: saasapi.InfoRes + (*ReadRes)(nil), // 31: saasapi.ReadRes + (*WriteRes)(nil), // 32: saasapi.WriteRes + (*ValueItem)(nil), // 33: saasapi.ValueItem + (*TaskListRes)(nil), // 34: saasapi.TaskListRes + (*TargetListRes)(nil), // 35: saasapi.TargetListRes + (*Binds)(nil), // 36: saasapi.Binds + (*Bind)(nil), // 37: saasapi.Bind + (*BindSetRes)(nil), // 38: saasapi.BindSetRes + (*BindDeleteRes)(nil), // 39: saasapi.BindDeleteRes + (*BindError)(nil), // 40: saasapi.BindError + (*ScriptRunRes)(nil), // 41: saasapi.ScriptRunRes + (*ScriptUpdateRes)(nil), // 42: saasapi.ScriptUpdateRes + nil, // 43: saasapi.TargetListRes.TargetListEntry } var file_cmd_proto_depIdxs = []int32{ - 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 + 7, // 0: saasapi.SaasReq.info:type_name -> saasapi.Info + 8, // 1: saasapi.SaasReq.read:type_name -> saasapi.Read + 10, // 2: saasapi.SaasReq.write:type_name -> saasapi.Write + 16, // 3: saasapi.SaasReq.column_write:type_name -> saasapi.ColumnWrite + 17, // 4: saasapi.SaasReq.task_create:type_name -> saasapi.Task + 18, // 5: saasapi.SaasReq.task_list:type_name -> saasapi.TaskList + 19, // 6: saasapi.SaasReq.task_run:type_name -> saasapi.TaskRun + 20, // 7: saasapi.SaasReq.task_delete:type_name -> saasapi.TaskDelete + 21, // 8: saasapi.SaasReq.task_info:type_name -> saasapi.TaskInfo + 24, // 9: saasapi.SaasReq.target_list:type_name -> saasapi.TargetList + 25, // 10: saasapi.SaasReq.bind_set:type_name -> saasapi.BindSet + 26, // 11: saasapi.SaasReq.bind_delete:type_name -> saasapi.BindDelete + 27, // 12: saasapi.SaasReq.script_run:type_name -> saasapi.ScriptRun + 28, // 13: saasapi.SaasReq.script_update:type_name -> saasapi.ScriptUpdate + 9, // 14: saasapi.Read.read_items:type_name -> saasapi.ReadItem + 11, // 15: saasapi.Write.write_items:type_name -> saasapi.WriteItem + 12, // 16: saasapi.WriteItem.write_bytes:type_name -> saasapi.Bytes + 13, // 17: saasapi.WriteItem.write_uint32s:type_name -> saasapi.Uint32s + 14, // 18: saasapi.WriteItem.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 15, // 19: saasapi.FlagsWithExpire.flags_with_expire:type_name -> saasapi.FlagWithExpire + 12, // 20: saasapi.ColumnWrite.write_bytes:type_name -> saasapi.Bytes + 13, // 21: saasapi.ColumnWrite.write_uint32s:type_name -> saasapi.Uint32s + 14, // 22: saasapi.ColumnWrite.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 22, // 23: saasapi.Task.task_file_infos:type_name -> saasapi.FileInfo + 4, // 24: saasapi.Task.status:type_name -> saasapi.TaskStatus + 4, // 25: saasapi.TaskList.status_filter:type_name -> saasapi.TaskStatus + 23, // 26: saasapi.FileInfo.file_blocks:type_name -> saasapi.FileBlock + 37, // 27: saasapi.BindSet.binds:type_name -> saasapi.Bind + 37, // 28: saasapi.BindDelete.binds:type_name -> saasapi.Bind + 5, // 29: saasapi.ScriptRun.os:type_name -> saasapi.OS 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 + 30, // 31: saasapi.SaasRes.info_res:type_name -> saasapi.InfoRes + 31, // 32: saasapi.SaasRes.read_res:type_name -> saasapi.ReadRes + 32, // 33: saasapi.SaasRes.write_res:type_name -> saasapi.WriteRes + 17, // 34: saasapi.SaasRes.task_create_res:type_name -> saasapi.Task + 34, // 35: saasapi.SaasRes.task_list_res:type_name -> saasapi.TaskListRes + 17, // 36: saasapi.SaasRes.task_run_res:type_name -> saasapi.Task + 17, // 37: saasapi.SaasRes.task_delete_res:type_name -> saasapi.Task + 17, // 38: saasapi.SaasRes.task_info_res:type_name -> saasapi.Task + 35, // 39: saasapi.SaasRes.target_list_res:type_name -> saasapi.TargetListRes + 38, // 40: saasapi.SaasRes.bind_set_res:type_name -> saasapi.BindSetRes + 39, // 41: saasapi.SaasRes.bind_delete_res:type_name -> saasapi.BindDeleteRes + 41, // 42: saasapi.SaasRes.script_run_res:type_name -> saasapi.ScriptRunRes + 42, // 43: saasapi.SaasRes.script_update_res:type_name -> saasapi.ScriptUpdateRes + 33, // 44: saasapi.ReadRes.cmd_res:type_name -> saasapi.ValueItem + 3, // 45: saasapi.ValueItem.cmd_code:type_name -> saasapi.CmdErrorCode + 15, // 46: saasapi.ValueItem.flags_with_expire:type_name -> saasapi.FlagWithExpire + 17, // 47: saasapi.TaskListRes.tasks:type_name -> saasapi.Task + 43, // 48: saasapi.TargetListRes.target_list:type_name -> saasapi.TargetListRes.TargetListEntry + 37, // 49: saasapi.Binds.binds:type_name -> saasapi.Bind + 0, // 50: saasapi.Bind.bind_type:type_name -> saasapi.BindType + 1, // 51: saasapi.Bind.bind_source:type_name -> saasapi.BindSourceType + 40, // 52: saasapi.BindSetRes.errors:type_name -> saasapi.BindError + 40, // 53: saasapi.BindDeleteRes.errors:type_name -> saasapi.BindError + 36, // 54: saasapi.TargetListRes.TargetListEntry.value:type_name -> saasapi.Binds + 55, // [55:55] is the sub-list for method output_type + 55, // [55:55] is the sub-list for method input_type + 55, // [55:55] is the sub-list for extension type_name + 55, // [55:55] is the sub-list for extension extendee + 0, // [0:55] is the sub-list for field type_name } func init() { file_cmd_proto_init() } @@ -3194,9 +3362,10 @@ func file_cmd_proto_init() { (*SaasReq_TargetList)(nil), (*SaasReq_BindSet)(nil), (*SaasReq_BindDelete)(nil), - (*SaasReq_Debug)(nil), + (*SaasReq_ScriptRun)(nil), + (*SaasReq_ScriptUpdate)(nil), } - file_cmd_proto_msgTypes[22].OneofWrappers = []any{ + file_cmd_proto_msgTypes[23].OneofWrappers = []any{ (*SaasRes_InfoRes)(nil), (*SaasRes_ReadRes)(nil), (*SaasRes_WriteRes)(nil), @@ -3208,14 +3377,16 @@ func file_cmd_proto_init() { (*SaasRes_TargetListRes)(nil), (*SaasRes_BindSetRes)(nil), (*SaasRes_BindDeleteRes)(nil), + (*SaasRes_ScriptRunRes)(nil), + (*SaasRes_ScriptUpdateRes)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_proto_rawDesc), len(file_cmd_proto_rawDesc)), - NumEnums: 5, - NumMessages: 36, + NumEnums: 6, + NumMessages: 38, NumExtensions: 0, NumServices: 0, }, diff --git a/cmd.proto b/cmd.proto index be71a51..9475dac 100644 --- a/cmd.proto +++ b/cmd.proto @@ -24,7 +24,8 @@ message SaasReq { BindSet bind_set = 61; // 设置绑定 BindDelete bind_delete = 62; // 解除绑定 - Debug debug = 90; // 试运行lua脚本 + ScriptRun script_run = 90; // 运行脚本 + ScriptUpdate script_update = 91; // 脚本升级 } } @@ -157,23 +158,25 @@ message TargetList { // BindSet 设置绑定 message BindSet { - repeated Bind binds = 2; // 设置绑定内容 + repeated Bind binds = 2; // 设置绑定内容 } // BindDelete 删除绑定 message BindDelete { - repeated Bind binds = 2; // 解除绑定内容 + repeated Bind binds = 2; // 解除绑定内容 } -// Debug 调试 -message Debug { +// ScriptRun 运行脚本 +message ScriptRun { string lua_script = 1; // 要调试的lua脚本 - bool use_server_data = 2; // 是否使用服务端用户数据 - string server_did = 3; // 将从服务端读取该DID下的数据 - string appid = 4; // 小程序/小游戏/公众号/视频号的appid - string server_openid = 5; // 将从服务端读取该openid下的数据,需与appid配对使用 - WriteItem local_did_data = 6; // 客户自定义DID用户数据 - WriteItem local_openid_data = 7; // 客户定定义OpenID用户数据 + string server_did = 2; // 将从服务端读取该DID下的数据 + string appid = 3; // 小程序/小游戏/公众号/视频号的appid + string server_openid = 4; // 将从服务端读取该openid下的数据,需与appid配对使用 + OS os = 5; // 操作系统 +} + +// ScriptUpdate 升级脚本 +message ScriptUpdate { } // SaasRes 命令返回 @@ -196,13 +199,16 @@ message SaasRes { BindSetRes bind_set_res = 61; // 设置绑定返回状态 BindDeleteRes bind_delete_res = 62; // 删除绑定返回状态 + + ScriptRunRes script_run_res = 90; // 运行脚本返回 + ScriptUpdateRes script_update_res = 91; // 升级脚本返回 } } // InfoRes 账号信息返回 message InfoRes { - repeated string dataspace_id = 1; // 可用数据区 - repeated string target_id = 2; // 策略ID + repeated string dataspace_id = 1; // 可用数据区列表 + repeated string target_id = 2; // 策略ID列表 } @@ -215,8 +221,8 @@ message ReadRes { // WriteRes 写记录返回 message WriteRes { - //uint32 succ_cmd_count = 1; // 成功的命令数量 - //uint32 fail_cmd_count = 2; // 失败的命令数量 + //uint32 succ_cmd_count = 1; // 成功的命令数量 + //uint32 fail_cmd_count = 2; // 失败的命令数量 repeated string failed_userid = 3; // 返回的失败的用户ID } @@ -292,11 +298,15 @@ message BindError { } -// DebugRes 调试返回 -message DebugRes { - string PrintOutput = 1; // print输出 - string Error = 2; // 错误信息 - string TargetsOutput = 3; // 策略输出 +// ScriptRunRes 运行脚本返回 +message ScriptRunRes { + string print_output = 1; // print输出 + string error = 2; // 错误信息 + string targets_output = 3; // 策略输出 +} + +// ScriptUpdateRes 升级脚本返回 +message ScriptUpdateRes { } // ErrorCode 返回码 @@ -346,6 +356,12 @@ enum TaskStatus { SUCCESS = 4; // 成功 FAIL = 5; // 失败 - DELETED = 10; // 已删除,仅在执行删除成功时返回 + DELETED = 10; // 已删除,仅在执行删除成功时返回 +} + +enum OS { + UNKNOWN = 0; + IOS = 1; + ANDROID = 2; } diff --git a/cmd/saastool/bind.go b/cmd/saastool/bind.go index 95e0b55..0621807 100644 --- a/cmd/saastool/bind.go +++ b/cmd/saastool/bind.go @@ -37,7 +37,7 @@ Usage: saastoola bind COMMAND [OPTIONS] Commands: setaccount Set Account binds - setad Set AdGroup binds + setad Set AdGroup binds delete Delete binds "help" is the default command.