From 430ce87959c8325678cfebdd1f8452b06597467b Mon Sep 17 00:00:00 2001 From: algotao Date: Fri, 14 Nov 2025 19:24:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd.pb.go | 719 ++++++++++++++++++++++++----------- cmd.proto | 24 ++ cmd/saastool/grant.go | 46 +++ cmd/saastool/grant_add.go | 91 +++++ cmd/saastool/grant_delete.go | 91 +++++ cmd/saastool/grant_list.go | 70 ++++ cmd/saastool/help.go | 1 + cmd/saastool/main.go | 2 + cmd/saastool/params.go | 8 + pkg/saashttp/cfg.go | 24 ++ pkg/saashttp/httpcli.go | 15 + 11 files changed, 867 insertions(+), 224 deletions(-) create mode 100644 cmd/saastool/grant.go create mode 100644 cmd/saastool/grant_add.go create mode 100644 cmd/saastool/grant_delete.go create mode 100644 cmd/saastool/grant_list.go diff --git a/cmd.pb.go b/cmd.pb.go index 182669d..033b175 100644 --- a/cmd.pb.go +++ b/cmd.pb.go @@ -478,6 +478,9 @@ type SaasReq struct { // *SaasReq_TargetDelete // *SaasReq_BindSet // *SaasReq_BindDelete + // *SaasReq_GrantList + // *SaasReq_GrantAdd + // *SaasReq_GrantDelete // *SaasReq_ScriptRun // *SaasReq_ScriptCreate // *SaasReq_ScriptList @@ -654,6 +657,33 @@ func (x *SaasReq) GetBindDelete() *BindDelete { return nil } +func (x *SaasReq) GetGrantList() *GrantList { + if x != nil { + if x, ok := x.Cmd.(*SaasReq_GrantList); ok { + return x.GrantList + } + } + return nil +} + +func (x *SaasReq) GetGrantAdd() *Grant { + if x != nil { + if x, ok := x.Cmd.(*SaasReq_GrantAdd); ok { + return x.GrantAdd + } + } + return nil +} + +func (x *SaasReq) GetGrantDelete() *Grant { + if x != nil { + if x, ok := x.Cmd.(*SaasReq_GrantDelete); ok { + return x.GrantDelete + } + } + return nil +} + func (x *SaasReq) GetScriptRun() *ScriptRun { if x != nil { if x, ok := x.Cmd.(*SaasReq_ScriptRun); ok { @@ -786,6 +816,18 @@ type SaasReq_BindDelete struct { BindDelete *BindDelete `protobuf:"bytes,62,opt,name=bind_delete,json=bindDelete,proto3,oneof"` // 解除绑定 } +type SaasReq_GrantList struct { + GrantList *GrantList `protobuf:"bytes,70,opt,name=grant_list,json=grantList,proto3,oneof"` // 列出数据授权 +} + +type SaasReq_GrantAdd struct { + GrantAdd *Grant `protobuf:"bytes,71,opt,name=grant_add,json=grantAdd,proto3,oneof"` // 增加数据授权 +} + +type SaasReq_GrantDelete struct { + GrantDelete *Grant `protobuf:"bytes,72,opt,name=grant_delete,json=grantDelete,proto3,oneof"` // 删除数据授权 +} + type SaasReq_ScriptRun struct { ScriptRun *ScriptRun `protobuf:"bytes,90,opt,name=script_run,json=scriptRun,proto3,oneof"` // 运行脚本 } @@ -846,6 +888,12 @@ func (*SaasReq_BindSet) isSaasReq_Cmd() {} func (*SaasReq_BindDelete) isSaasReq_Cmd() {} +func (*SaasReq_GrantList) isSaasReq_Cmd() {} + +func (*SaasReq_GrantAdd) isSaasReq_Cmd() {} + +func (*SaasReq_GrantDelete) isSaasReq_Cmd() {} + func (*SaasReq_ScriptRun) isSaasReq_Cmd() {} func (*SaasReq_ScriptCreate) isSaasReq_Cmd() {} @@ -2132,6 +2180,96 @@ func (x *BindDelete) GetBinds() []*Bind { return nil } +// GrantList 列出数据授权 +type GrantList struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrantList) Reset() { + *x = GrantList{} + mi := &file_cmd_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrantList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantList) ProtoMessage() {} + +func (x *GrantList) 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 GrantList.ProtoReflect.Descriptor instead. +func (*GrantList) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{23} +} + +// Grant 数据授权信息 +type Grant struct { + state protoimpl.MessageState `protogen:"open.v1"` + SrtaAccountId uint32 `protobuf:"varint,1,opt,name=srta_account_id,json=srtaAccountId,proto3" json:"srta_account_id,omitempty"` // sRTA授权目标账号ID + GrantIndex string `protobuf:"bytes,2,opt,name=grant_index,json=grantIndex,proto3" json:"grant_index,omitempty"` // 授权索引。格式为 "index1, index2, index55-index64",例如 "1, 2, 55-64" + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Grant) Reset() { + *x = Grant{} + mi := &file_cmd_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Grant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Grant) ProtoMessage() {} + +func (x *Grant) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[24] + 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 Grant.ProtoReflect.Descriptor instead. +func (*Grant) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{24} +} + +func (x *Grant) GetSrtaAccountId() uint32 { + if x != nil { + return x.SrtaAccountId + } + return 0 +} + +func (x *Grant) GetGrantIndex() string { + if x != nil { + return x.GrantIndex + } + return "" +} + // ScriptRun 运行脚本 type ScriptRun struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2146,7 +2284,7 @@ type ScriptRun struct { func (x *ScriptRun) Reset() { *x = ScriptRun{} - mi := &file_cmd_proto_msgTypes[23] + mi := &file_cmd_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2158,7 +2296,7 @@ func (x *ScriptRun) String() string { func (*ScriptRun) ProtoMessage() {} func (x *ScriptRun) 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 { @@ -2171,7 +2309,7 @@ func (x *ScriptRun) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptRun.ProtoReflect.Descriptor instead. func (*ScriptRun) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{23} + return file_cmd_proto_rawDescGZIP(), []int{25} } func (x *ScriptRun) GetLuaScript() string { @@ -2220,7 +2358,7 @@ type ScriptCreate struct { func (x *ScriptCreate) Reset() { *x = ScriptCreate{} - mi := &file_cmd_proto_msgTypes[24] + mi := &file_cmd_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2232,7 +2370,7 @@ func (x *ScriptCreate) String() string { func (*ScriptCreate) ProtoMessage() {} func (x *ScriptCreate) 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 { @@ -2245,7 +2383,7 @@ func (x *ScriptCreate) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptCreate.ProtoReflect.Descriptor instead. func (*ScriptCreate) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{24} + return file_cmd_proto_rawDescGZIP(), []int{26} } func (x *ScriptCreate) GetLuaName() string { @@ -2271,7 +2409,7 @@ type ScriptList struct { func (x *ScriptList) Reset() { *x = ScriptList{} - mi := &file_cmd_proto_msgTypes[25] + mi := &file_cmd_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2283,7 +2421,7 @@ func (x *ScriptList) String() string { func (*ScriptList) ProtoMessage() {} func (x *ScriptList) 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 { @@ -2296,7 +2434,7 @@ func (x *ScriptList) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptList.ProtoReflect.Descriptor instead. func (*ScriptList) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{25} + return file_cmd_proto_rawDescGZIP(), []int{27} } // ScriptDelete 删除脚本 @@ -2309,7 +2447,7 @@ type ScriptDelete struct { func (x *ScriptDelete) Reset() { *x = ScriptDelete{} - mi := &file_cmd_proto_msgTypes[26] + mi := &file_cmd_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2321,7 +2459,7 @@ func (x *ScriptDelete) String() string { func (*ScriptDelete) ProtoMessage() {} func (x *ScriptDelete) 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 { @@ -2334,7 +2472,7 @@ func (x *ScriptDelete) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptDelete.ProtoReflect.Descriptor instead. func (*ScriptDelete) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{26} + return file_cmd_proto_rawDescGZIP(), []int{28} } func (x *ScriptDelete) GetLuaName() string { @@ -2354,7 +2492,7 @@ type ScriptGet struct { func (x *ScriptGet) Reset() { *x = ScriptGet{} - mi := &file_cmd_proto_msgTypes[27] + mi := &file_cmd_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2366,7 +2504,7 @@ func (x *ScriptGet) String() string { func (*ScriptGet) ProtoMessage() {} func (x *ScriptGet) 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 { @@ -2379,7 +2517,7 @@ func (x *ScriptGet) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptGet.ProtoReflect.Descriptor instead. func (*ScriptGet) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{27} + return file_cmd_proto_rawDescGZIP(), []int{29} } func (x *ScriptGet) GetLuaName() string { @@ -2399,7 +2537,7 @@ type ScriptUse struct { func (x *ScriptUse) Reset() { *x = ScriptUse{} - mi := &file_cmd_proto_msgTypes[28] + mi := &file_cmd_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2411,7 +2549,7 @@ func (x *ScriptUse) String() string { func (*ScriptUse) ProtoMessage() {} func (x *ScriptUse) 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 { @@ -2424,7 +2562,7 @@ func (x *ScriptUse) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptUse.ProtoReflect.Descriptor instead. func (*ScriptUse) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{28} + return file_cmd_proto_rawDescGZIP(), []int{30} } func (x *ScriptUse) GetLuaName() string { @@ -2443,7 +2581,7 @@ type ExpList struct { func (x *ExpList) Reset() { *x = ExpList{} - mi := &file_cmd_proto_msgTypes[29] + mi := &file_cmd_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2455,7 +2593,7 @@ func (x *ExpList) String() string { func (*ExpList) ProtoMessage() {} func (x *ExpList) 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 { @@ -2468,7 +2606,7 @@ func (x *ExpList) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpList.ProtoReflect.Descriptor instead. func (*ExpList) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{29} + return file_cmd_proto_rawDescGZIP(), []int{31} } // ExpGet 获取实验报表 @@ -2496,7 +2634,7 @@ type ExpGet struct { func (x *ExpGet) Reset() { *x = ExpGet{} - mi := &file_cmd_proto_msgTypes[30] + mi := &file_cmd_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2508,7 +2646,7 @@ func (x *ExpGet) String() string { func (*ExpGet) ProtoMessage() {} func (x *ExpGet) 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 { @@ -2521,7 +2659,7 @@ func (x *ExpGet) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpGet.ProtoReflect.Descriptor instead. func (*ExpGet) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{30} + return file_cmd_proto_rawDescGZIP(), []int{32} } func (x *ExpGet) GetExtFields() []string { @@ -2600,6 +2738,9 @@ type SaasRes struct { // *SaasRes_TargetDeleteRes // *SaasRes_BindSetRes // *SaasRes_BindDeleteRes + // *SaasRes_GrantListRes + // *SaasRes_GrantAddRes + // *SaasRes_GrantDeleteRes // *SaasRes_ScriptRunRes // *SaasRes_ScriptCreateRes // *SaasRes_ScriptListRes @@ -2615,7 +2756,7 @@ type SaasRes struct { func (x *SaasRes) Reset() { *x = SaasRes{} - mi := &file_cmd_proto_msgTypes[31] + mi := &file_cmd_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2627,7 +2768,7 @@ func (x *SaasRes) String() string { func (*SaasRes) ProtoMessage() {} func (x *SaasRes) 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 { @@ -2640,7 +2781,7 @@ func (x *SaasRes) ProtoReflect() protoreflect.Message { // Deprecated: Use SaasRes.ProtoReflect.Descriptor instead. func (*SaasRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{31} + return file_cmd_proto_rawDescGZIP(), []int{33} } func (x *SaasRes) GetCode() ErrorCode { @@ -2781,6 +2922,33 @@ func (x *SaasRes) GetBindDeleteRes() *BindDeleteRes { return nil } +func (x *SaasRes) GetGrantListRes() *GrantListRes { + if x != nil { + if x, ok := x.Res.(*SaasRes_GrantListRes); ok { + return x.GrantListRes + } + } + return nil +} + +func (x *SaasRes) GetGrantAddRes() *Grant { + if x != nil { + if x, ok := x.Res.(*SaasRes_GrantAddRes); ok { + return x.GrantAddRes + } + } + return nil +} + +func (x *SaasRes) GetGrantDeleteRes() *Grant { + if x != nil { + if x, ok := x.Res.(*SaasRes_GrantDeleteRes); ok { + return x.GrantDeleteRes + } + } + return nil +} + func (x *SaasRes) GetScriptRunRes() *ScriptRunRes { if x != nil { if x, ok := x.Res.(*SaasRes_ScriptRunRes); ok { @@ -2909,6 +3077,18 @@ type SaasRes_BindDeleteRes struct { BindDeleteRes *BindDeleteRes `protobuf:"bytes,62,opt,name=bind_delete_res,json=bindDeleteRes,proto3,oneof"` // 删除绑定返回状态 } +type SaasRes_GrantListRes struct { + GrantListRes *GrantListRes `protobuf:"bytes,70,opt,name=grant_list_res,json=grantListRes,proto3,oneof"` // 列出数据授权返回状态 +} + +type SaasRes_GrantAddRes struct { + GrantAddRes *Grant `protobuf:"bytes,71,opt,name=grant_add_res,json=grantAddRes,proto3,oneof"` // 增加数据授权返回状态 +} + +type SaasRes_GrantDeleteRes struct { + GrantDeleteRes *Grant `protobuf:"bytes,72,opt,name=grant_delete_res,json=grantDeleteRes,proto3,oneof"` // 删除数据授权返回状态 +} + type SaasRes_ScriptRunRes struct { ScriptRunRes *ScriptRunRes `protobuf:"bytes,90,opt,name=script_run_res,json=scriptRunRes,proto3,oneof"` // 运行脚本返回 } @@ -2967,6 +3147,12 @@ func (*SaasRes_BindSetRes) isSaasRes_Res() {} func (*SaasRes_BindDeleteRes) isSaasRes_Res() {} +func (*SaasRes_GrantListRes) isSaasRes_Res() {} + +func (*SaasRes_GrantAddRes) isSaasRes_Res() {} + +func (*SaasRes_GrantDeleteRes) isSaasRes_Res() {} + func (*SaasRes_ScriptRunRes) isSaasRes_Res() {} func (*SaasRes_ScriptCreateRes) isSaasRes_Res() {} @@ -2993,7 +3179,7 @@ type DataSpace struct { func (x *DataSpace) Reset() { *x = DataSpace{} - mi := &file_cmd_proto_msgTypes[32] + mi := &file_cmd_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3005,7 +3191,7 @@ func (x *DataSpace) String() string { func (*DataSpace) ProtoMessage() {} func (x *DataSpace) 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 { @@ -3018,7 +3204,7 @@ func (x *DataSpace) ProtoReflect() protoreflect.Message { // Deprecated: Use DataSpace.ProtoReflect.Descriptor instead. func (*DataSpace) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{32} + return file_cmd_proto_rawDescGZIP(), []int{34} } func (x *DataSpace) GetDid() []string { @@ -3046,7 +3232,7 @@ type InfoRes struct { func (x *InfoRes) Reset() { *x = InfoRes{} - mi := &file_cmd_proto_msgTypes[33] + mi := &file_cmd_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3058,7 +3244,7 @@ func (x *InfoRes) String() string { func (*InfoRes) ProtoMessage() {} func (x *InfoRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[33] + mi := &file_cmd_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3071,7 +3257,7 @@ func (x *InfoRes) ProtoReflect() protoreflect.Message { // Deprecated: Use InfoRes.ProtoReflect.Descriptor instead. func (*InfoRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{33} + return file_cmd_proto_rawDescGZIP(), []int{35} } func (x *InfoRes) GetDataspace() *DataSpace { @@ -3100,7 +3286,7 @@ type ReadRes struct { func (x *ReadRes) Reset() { *x = ReadRes{} - mi := &file_cmd_proto_msgTypes[34] + mi := &file_cmd_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3112,7 +3298,7 @@ func (x *ReadRes) String() string { func (*ReadRes) ProtoMessage() {} func (x *ReadRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[34] + mi := &file_cmd_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3125,7 +3311,7 @@ func (x *ReadRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadRes.ProtoReflect.Descriptor instead. func (*ReadRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{34} + return file_cmd_proto_rawDescGZIP(), []int{36} } func (x *ReadRes) GetSuccCmdCount() uint32 { @@ -3161,7 +3347,7 @@ type WriteRes struct { func (x *WriteRes) Reset() { *x = WriteRes{} - mi := &file_cmd_proto_msgTypes[35] + mi := &file_cmd_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3173,7 +3359,7 @@ func (x *WriteRes) String() string { func (*WriteRes) ProtoMessage() {} func (x *WriteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[35] + mi := &file_cmd_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3186,7 +3372,7 @@ func (x *WriteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteRes.ProtoReflect.Descriptor instead. func (*WriteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{35} + return file_cmd_proto_rawDescGZIP(), []int{37} } func (x *WriteRes) GetFailedUserid() []string { @@ -3212,7 +3398,7 @@ type ValueItem struct { func (x *ValueItem) Reset() { *x = ValueItem{} - mi := &file_cmd_proto_msgTypes[36] + mi := &file_cmd_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3224,7 +3410,7 @@ func (x *ValueItem) String() string { func (*ValueItem) ProtoMessage() {} func (x *ValueItem) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[36] + mi := &file_cmd_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3237,7 +3423,7 @@ func (x *ValueItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ValueItem.ProtoReflect.Descriptor instead. func (*ValueItem) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{36} + return file_cmd_proto_rawDescGZIP(), []int{38} } func (x *ValueItem) GetCmdIndex() uint32 { @@ -3299,7 +3485,7 @@ type TaskListRes struct { func (x *TaskListRes) Reset() { *x = TaskListRes{} - mi := &file_cmd_proto_msgTypes[37] + mi := &file_cmd_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3311,7 +3497,7 @@ func (x *TaskListRes) String() string { func (*TaskListRes) ProtoMessage() {} func (x *TaskListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[37] + mi := &file_cmd_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3324,7 +3510,7 @@ func (x *TaskListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskListRes.ProtoReflect.Descriptor instead. func (*TaskListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{37} + return file_cmd_proto_rawDescGZIP(), []int{39} } func (x *TaskListRes) GetTasks() []*Task { @@ -3344,7 +3530,7 @@ type TargetListRes struct { func (x *TargetListRes) Reset() { *x = TargetListRes{} - mi := &file_cmd_proto_msgTypes[38] + mi := &file_cmd_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3356,7 +3542,7 @@ func (x *TargetListRes) String() string { func (*TargetListRes) ProtoMessage() {} func (x *TargetListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[38] + mi := &file_cmd_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3369,7 +3555,7 @@ func (x *TargetListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetListRes.ProtoReflect.Descriptor instead. func (*TargetListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{38} + return file_cmd_proto_rawDescGZIP(), []int{40} } func (x *TargetListRes) GetTargetList() map[string]*Binds { @@ -3390,7 +3576,7 @@ type TargetCreateRes struct { func (x *TargetCreateRes) Reset() { *x = TargetCreateRes{} - mi := &file_cmd_proto_msgTypes[39] + mi := &file_cmd_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3402,7 +3588,7 @@ func (x *TargetCreateRes) String() string { func (*TargetCreateRes) ProtoMessage() {} func (x *TargetCreateRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[39] + mi := &file_cmd_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3415,7 +3601,7 @@ func (x *TargetCreateRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetCreateRes.ProtoReflect.Descriptor instead. func (*TargetCreateRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{39} + return file_cmd_proto_rawDescGZIP(), []int{41} } func (x *TargetCreateRes) GetTargetId() string { @@ -3443,7 +3629,7 @@ type TargetDeleteRes struct { func (x *TargetDeleteRes) Reset() { *x = TargetDeleteRes{} - mi := &file_cmd_proto_msgTypes[40] + mi := &file_cmd_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3455,7 +3641,7 @@ func (x *TargetDeleteRes) String() string { func (*TargetDeleteRes) ProtoMessage() {} func (x *TargetDeleteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[40] + mi := &file_cmd_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3468,7 +3654,7 @@ func (x *TargetDeleteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetDeleteRes.ProtoReflect.Descriptor instead. func (*TargetDeleteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{40} + return file_cmd_proto_rawDescGZIP(), []int{42} } func (x *TargetDeleteRes) GetTargetId() string { @@ -3494,7 +3680,7 @@ type Binds struct { func (x *Binds) Reset() { *x = Binds{} - mi := &file_cmd_proto_msgTypes[41] + mi := &file_cmd_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3506,7 +3692,7 @@ func (x *Binds) String() string { func (*Binds) ProtoMessage() {} func (x *Binds) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[41] + mi := &file_cmd_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3519,7 +3705,7 @@ func (x *Binds) ProtoReflect() protoreflect.Message { // Deprecated: Use Binds.ProtoReflect.Descriptor instead. func (*Binds) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{41} + return file_cmd_proto_rawDescGZIP(), []int{43} } func (x *Binds) GetBinds() []*Bind { @@ -3543,7 +3729,7 @@ type Bind struct { func (x *Bind) Reset() { *x = Bind{} - mi := &file_cmd_proto_msgTypes[42] + mi := &file_cmd_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3555,7 +3741,7 @@ func (x *Bind) String() string { func (*Bind) ProtoMessage() {} func (x *Bind) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[42] + mi := &file_cmd_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3568,7 +3754,7 @@ func (x *Bind) ProtoReflect() protoreflect.Message { // Deprecated: Use Bind.ProtoReflect.Descriptor instead. func (*Bind) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{42} + return file_cmd_proto_rawDescGZIP(), []int{44} } func (x *Bind) GetBindId() int64 { @@ -3618,7 +3804,7 @@ type BindSetRes struct { func (x *BindSetRes) Reset() { *x = BindSetRes{} - mi := &file_cmd_proto_msgTypes[43] + mi := &file_cmd_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3630,7 +3816,7 @@ func (x *BindSetRes) String() string { func (*BindSetRes) ProtoMessage() {} func (x *BindSetRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[43] + mi := &file_cmd_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3643,7 +3829,7 @@ func (x *BindSetRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindSetRes.ProtoReflect.Descriptor instead. func (*BindSetRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{43} + return file_cmd_proto_rawDescGZIP(), []int{45} } func (x *BindSetRes) GetSuccessNum() int32 { @@ -3679,7 +3865,7 @@ type BindDeleteRes struct { func (x *BindDeleteRes) Reset() { *x = BindDeleteRes{} - mi := &file_cmd_proto_msgTypes[44] + mi := &file_cmd_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3691,7 +3877,7 @@ func (x *BindDeleteRes) String() string { func (*BindDeleteRes) ProtoMessage() {} func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[44] + mi := &file_cmd_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3704,7 +3890,7 @@ func (x *BindDeleteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use BindDeleteRes.ProtoReflect.Descriptor instead. func (*BindDeleteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{44} + return file_cmd_proto_rawDescGZIP(), []int{46} } func (x *BindDeleteRes) GetSuccessNum() int32 { @@ -3740,7 +3926,7 @@ type BindError struct { func (x *BindError) Reset() { *x = BindError{} - mi := &file_cmd_proto_msgTypes[45] + mi := &file_cmd_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3752,7 +3938,7 @@ func (x *BindError) String() string { func (*BindError) ProtoMessage() {} func (x *BindError) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[45] + mi := &file_cmd_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3765,7 +3951,7 @@ func (x *BindError) ProtoReflect() protoreflect.Message { // Deprecated: Use BindError.ProtoReflect.Descriptor instead. func (*BindError) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{45} + return file_cmd_proto_rawDescGZIP(), []int{47} } func (x *BindError) GetBindId() int64 { @@ -3789,6 +3975,59 @@ func (x *BindError) GetReason() string { return "" } +// GrantListRes 授权列表返回 +type GrantListRes struct { + state protoimpl.MessageState `protogen:"open.v1"` + From []*Grant `protobuf:"bytes,1,rep,name=from,proto3" json:"from,omitempty"` // 被授权列表 + To []*Grant `protobuf:"bytes,2,rep,name=to,proto3" json:"to,omitempty"` // 向外授权列表 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrantListRes) Reset() { + *x = GrantListRes{} + mi := &file_cmd_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrantListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantListRes) ProtoMessage() {} + +func (x *GrantListRes) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[48] + 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 GrantListRes.ProtoReflect.Descriptor instead. +func (*GrantListRes) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{48} +} + +func (x *GrantListRes) GetFrom() []*Grant { + if x != nil { + return x.From + } + return nil +} + +func (x *GrantListRes) GetTo() []*Grant { + if x != nil { + return x.To + } + return nil +} + // ScriptRunRes 运行脚本返回 type ScriptRunRes struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3802,7 +4041,7 @@ type ScriptRunRes struct { func (x *ScriptRunRes) Reset() { *x = ScriptRunRes{} - mi := &file_cmd_proto_msgTypes[46] + mi := &file_cmd_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3814,7 +4053,7 @@ func (x *ScriptRunRes) String() string { func (*ScriptRunRes) ProtoMessage() {} func (x *ScriptRunRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[46] + mi := &file_cmd_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3827,7 +4066,7 @@ func (x *ScriptRunRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptRunRes.ProtoReflect.Descriptor instead. func (*ScriptRunRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{46} + return file_cmd_proto_rawDescGZIP(), []int{49} } func (x *ScriptRunRes) GetPrintOutput() string { @@ -3870,7 +4109,7 @@ type ScriptInfo struct { func (x *ScriptInfo) Reset() { *x = ScriptInfo{} - mi := &file_cmd_proto_msgTypes[47] + mi := &file_cmd_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3882,7 +4121,7 @@ func (x *ScriptInfo) String() string { func (*ScriptInfo) ProtoMessage() {} func (x *ScriptInfo) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[47] + mi := &file_cmd_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3895,7 +4134,7 @@ func (x *ScriptInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptInfo.ProtoReflect.Descriptor instead. func (*ScriptInfo) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{47} + return file_cmd_proto_rawDescGZIP(), []int{50} } func (x *ScriptInfo) GetLuaName() string { @@ -3936,7 +4175,7 @@ type ScriptCreateRes struct { func (x *ScriptCreateRes) Reset() { *x = ScriptCreateRes{} - mi := &file_cmd_proto_msgTypes[48] + mi := &file_cmd_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3948,7 +4187,7 @@ func (x *ScriptCreateRes) String() string { func (*ScriptCreateRes) ProtoMessage() {} func (x *ScriptCreateRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[48] + mi := &file_cmd_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3961,7 +4200,7 @@ func (x *ScriptCreateRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptCreateRes.ProtoReflect.Descriptor instead. func (*ScriptCreateRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{48} + return file_cmd_proto_rawDescGZIP(), []int{51} } func (x *ScriptCreateRes) GetScriptInfo() *ScriptInfo { @@ -3981,7 +4220,7 @@ type ScriptListRes struct { func (x *ScriptListRes) Reset() { *x = ScriptListRes{} - mi := &file_cmd_proto_msgTypes[49] + mi := &file_cmd_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3993,7 +4232,7 @@ func (x *ScriptListRes) String() string { func (*ScriptListRes) ProtoMessage() {} func (x *ScriptListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[49] + mi := &file_cmd_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4006,7 +4245,7 @@ func (x *ScriptListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptListRes.ProtoReflect.Descriptor instead. func (*ScriptListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{49} + return file_cmd_proto_rawDescGZIP(), []int{52} } func (x *ScriptListRes) GetScriptInfo() []*ScriptInfo { @@ -4026,7 +4265,7 @@ type ScriptGetRes struct { func (x *ScriptGetRes) Reset() { *x = ScriptGetRes{} - mi := &file_cmd_proto_msgTypes[50] + mi := &file_cmd_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4038,7 +4277,7 @@ func (x *ScriptGetRes) String() string { func (*ScriptGetRes) ProtoMessage() {} func (x *ScriptGetRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[50] + mi := &file_cmd_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4051,7 +4290,7 @@ func (x *ScriptGetRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptGetRes.ProtoReflect.Descriptor instead. func (*ScriptGetRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{50} + return file_cmd_proto_rawDescGZIP(), []int{53} } func (x *ScriptGetRes) GetScriptInfo() *ScriptInfo { @@ -4071,7 +4310,7 @@ type ScriptDeleteRes struct { func (x *ScriptDeleteRes) Reset() { *x = ScriptDeleteRes{} - mi := &file_cmd_proto_msgTypes[51] + mi := &file_cmd_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4083,7 +4322,7 @@ func (x *ScriptDeleteRes) String() string { func (*ScriptDeleteRes) ProtoMessage() {} func (x *ScriptDeleteRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[51] + mi := &file_cmd_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4096,7 +4335,7 @@ func (x *ScriptDeleteRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptDeleteRes.ProtoReflect.Descriptor instead. func (*ScriptDeleteRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{51} + return file_cmd_proto_rawDescGZIP(), []int{54} } func (x *ScriptDeleteRes) GetScriptInfo() *ScriptInfo { @@ -4116,7 +4355,7 @@ type ScriptUseRes struct { func (x *ScriptUseRes) Reset() { *x = ScriptUseRes{} - mi := &file_cmd_proto_msgTypes[52] + mi := &file_cmd_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4128,7 +4367,7 @@ func (x *ScriptUseRes) String() string { func (*ScriptUseRes) ProtoMessage() {} func (x *ScriptUseRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[52] + mi := &file_cmd_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4141,7 +4380,7 @@ func (x *ScriptUseRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptUseRes.ProtoReflect.Descriptor instead. func (*ScriptUseRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{52} + return file_cmd_proto_rawDescGZIP(), []int{55} } func (x *ScriptUseRes) GetScriptInfo() *ScriptInfo { @@ -4161,7 +4400,7 @@ type ExpListRes struct { func (x *ExpListRes) Reset() { *x = ExpListRes{} - mi := &file_cmd_proto_msgTypes[53] + mi := &file_cmd_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4173,7 +4412,7 @@ func (x *ExpListRes) String() string { func (*ExpListRes) ProtoMessage() {} func (x *ExpListRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[53] + mi := &file_cmd_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4186,7 +4425,7 @@ func (x *ExpListRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpListRes.ProtoReflect.Descriptor instead. func (*ExpListRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{53} + return file_cmd_proto_rawDescGZIP(), []int{56} } func (x *ExpListRes) GetBuckets() []*ExpBucket { @@ -4207,7 +4446,7 @@ type ExpBucket struct { func (x *ExpBucket) Reset() { *x = ExpBucket{} - mi := &file_cmd_proto_msgTypes[54] + mi := &file_cmd_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4219,7 +4458,7 @@ func (x *ExpBucket) String() string { func (*ExpBucket) ProtoMessage() {} func (x *ExpBucket) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[54] + mi := &file_cmd_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4232,7 +4471,7 @@ func (x *ExpBucket) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpBucket.ProtoReflect.Descriptor instead. func (*ExpBucket) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{54} + return file_cmd_proto_rawDescGZIP(), []int{57} } func (x *ExpBucket) GetBucketId() uint32 { @@ -4266,7 +4505,7 @@ type ExpGetRes struct { func (x *ExpGetRes) Reset() { *x = ExpGetRes{} - mi := &file_cmd_proto_msgTypes[55] + mi := &file_cmd_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4278,7 +4517,7 @@ func (x *ExpGetRes) String() string { func (*ExpGetRes) ProtoMessage() {} func (x *ExpGetRes) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[55] + mi := &file_cmd_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4291,7 +4530,7 @@ func (x *ExpGetRes) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpGetRes.ProtoReflect.Descriptor instead. func (*ExpGetRes) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{55} + return file_cmd_proto_rawDescGZIP(), []int{58} } func (x *ExpGetRes) GetExpData() []*ExpData { @@ -4314,7 +4553,7 @@ type ExpData struct { func (x *ExpData) Reset() { *x = ExpData{} - mi := &file_cmd_proto_msgTypes[56] + mi := &file_cmd_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4326,7 +4565,7 @@ func (x *ExpData) String() string { func (*ExpData) ProtoMessage() {} func (x *ExpData) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[56] + mi := &file_cmd_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4339,7 +4578,7 @@ func (x *ExpData) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpData.ProtoReflect.Descriptor instead. func (*ExpData) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{56} + return file_cmd_proto_rawDescGZIP(), []int{59} } func (x *ExpData) GetTime() uint64 { @@ -4396,7 +4635,7 @@ type ExpBaseFields struct { func (x *ExpBaseFields) Reset() { *x = ExpBaseFields{} - mi := &file_cmd_proto_msgTypes[57] + mi := &file_cmd_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4408,7 +4647,7 @@ func (x *ExpBaseFields) String() string { func (*ExpBaseFields) ProtoMessage() {} func (x *ExpBaseFields) ProtoReflect() protoreflect.Message { - mi := &file_cmd_proto_msgTypes[57] + mi := &file_cmd_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4421,7 +4660,7 @@ func (x *ExpBaseFields) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpBaseFields.ProtoReflect.Descriptor instead. func (*ExpBaseFields) Descriptor() ([]byte, []int) { - return file_cmd_proto_rawDescGZIP(), []int{57} + return file_cmd_proto_rawDescGZIP(), []int{60} } func (x *ExpBaseFields) GetCost() float64 { @@ -4505,7 +4744,8 @@ var File_cmd_proto protoreflect.FileDescriptor const file_cmd_proto_rawDesc = "" + "\n" + - "\tcmd.proto\x12\asaasapi\"\x83\t\n" + + "\tcmd.proto\x12\asaasapi\"\x9c\n" + + "\n" + "\aSaasReq\x12#\n" + "\x04info\x18\x05 \x01(\v2\r.saasapi.InfoH\x00R\x04info\x12#\n" + "\x04read\x18\n" + @@ -4527,6 +4767,10 @@ const file_cmd_proto_rawDesc = "" + "\vbind_delete\x18> \x01(\v2\x13.saasapi.BindDeleteH\x00R\n" + "bindDelete\x123\n" + "\n" + + "grant_list\x18F \x01(\v2\x12.saasapi.GrantListH\x00R\tgrantList\x12-\n" + + "\tgrant_add\x18G \x01(\v2\x0e.saasapi.GrantH\x00R\bgrantAdd\x123\n" + + "\fgrant_delete\x18H \x01(\v2\x0e.saasapi.GrantH\x00R\vgrantDelete\x123\n" + + "\n" + "script_run\x18Z \x01(\v2\x12.saasapi.ScriptRunH\x00R\tscriptRun\x12<\n" + "\rscript_create\x18[ \x01(\v2\x15.saasapi.ScriptCreateH\x00R\fscriptCreate\x126\n" + "\vscript_list\x18\\ \x01(\v2\x13.saasapi.ScriptListH\x00R\n" + @@ -4634,7 +4878,12 @@ 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\"\xa1\x01\n" + + "\x05binds\x18\x02 \x03(\v2\r.saasapi.BindR\x05binds\"\v\n" + + "\tGrantList\"P\n" + + "\x05Grant\x12&\n" + + "\x0fsrta_account_id\x18\x01 \x01(\rR\rsrtaAccountId\x12\x1f\n" + + "\vgrant_index\x18\x02 \x01(\tR\n" + + "grantIndex\"\xa1\x01\n" + "\tScriptRun\x12\x1d\n" + "\n" + "lua_script\x18\x01 \x01(\tR\tluaScript\x12\x1d\n" + @@ -4667,8 +4916,7 @@ const file_cmd_proto_rawDesc = "" + "\x13where_advertiser_id\x18\x0e \x03(\x04R\x11whereAdvertiserId\x12\x19\n" + "\bgroup_by\x18\x14 \x03(\tR\agroupBy\x12\x1d\n" + "\n" + - "total_flag\x18\x1e \x01(\rR\ttotalFlag\"\xc1\n" + - "\n" + + "total_flag\x18\x1e \x01(\rR\ttotalFlag\"\xf2\v\n" + "\aSaasRes\x12&\n" + "\x04code\x18\x01 \x01(\x0e2\x12.saasapi.ErrorCodeR\x04code\x12\x16\n" + "\x06status\x18\x02 \x01(\tR\x06status\x12-\n" + @@ -4688,6 +4936,9 @@ 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\rbindDeleteRes\x12=\n" + + "\x0egrant_list_res\x18F \x01(\v2\x15.saasapi.GrantListResH\x00R\fgrantListRes\x124\n" + + "\rgrant_add_res\x18G \x01(\v2\x0e.saasapi.GrantH\x00R\vgrantAddRes\x12:\n" + + "\x10grant_delete_res\x18H \x01(\v2\x0e.saasapi.GrantH\x00R\x0egrantDeleteRes\x12=\n" + "\x0escript_run_res\x18Z \x01(\v2\x15.saasapi.ScriptRunResH\x00R\fscriptRunRes\x12F\n" + "\x11script_create_res\x18[ \x01(\v2\x18.saasapi.ScriptCreateResH\x00R\x0fscriptCreateRes\x12@\n" + "\x0fscript_list_res\x18\\ \x01(\v2\x16.saasapi.ScriptListResH\x00R\rscriptListRes\x12F\n" + @@ -4756,7 +5007,10 @@ 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\"\xa0\x01\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"R\n" + + "\fGrantListRes\x12\"\n" + + "\x04from\x18\x01 \x03(\v2\x0e.saasapi.GrantR\x04from\x12\x1e\n" + + "\x02to\x18\x02 \x03(\v2\x0e.saasapi.GrantR\x02to\"\xa0\x01\n" + "\fScriptRunRes\x12!\n" + "\fprint_output\x18\x01 \x01(\tR\vprintOutput\x12!\n" + "\ferror_output\x18\x02 \x01(\tR\verrorOutput\x12%\n" + @@ -4903,7 +5157,7 @@ func file_cmd_proto_rawDescGZIP() []byte { } var file_cmd_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 61) +var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 64) var file_cmd_proto_goTypes = []any{ (BindType)(0), // 0: saasapi.BindType (BindSourceType)(0), // 1: saasapi.BindSourceType @@ -4935,44 +5189,47 @@ var file_cmd_proto_goTypes = []any{ (*TargetDelete)(nil), // 27: saasapi.TargetDelete (*BindSet)(nil), // 28: saasapi.BindSet (*BindDelete)(nil), // 29: saasapi.BindDelete - (*ScriptRun)(nil), // 30: saasapi.ScriptRun - (*ScriptCreate)(nil), // 31: saasapi.ScriptCreate - (*ScriptList)(nil), // 32: saasapi.ScriptList - (*ScriptDelete)(nil), // 33: saasapi.ScriptDelete - (*ScriptGet)(nil), // 34: saasapi.ScriptGet - (*ScriptUse)(nil), // 35: saasapi.ScriptUse - (*ExpList)(nil), // 36: saasapi.ExpList - (*ExpGet)(nil), // 37: saasapi.ExpGet - (*SaasRes)(nil), // 38: saasapi.SaasRes - (*DataSpace)(nil), // 39: saasapi.DataSpace - (*InfoRes)(nil), // 40: saasapi.InfoRes - (*ReadRes)(nil), // 41: saasapi.ReadRes - (*WriteRes)(nil), // 42: saasapi.WriteRes - (*ValueItem)(nil), // 43: saasapi.ValueItem - (*TaskListRes)(nil), // 44: saasapi.TaskListRes - (*TargetListRes)(nil), // 45: saasapi.TargetListRes - (*TargetCreateRes)(nil), // 46: saasapi.TargetCreateRes - (*TargetDeleteRes)(nil), // 47: saasapi.TargetDeleteRes - (*Binds)(nil), // 48: saasapi.Binds - (*Bind)(nil), // 49: saasapi.Bind - (*BindSetRes)(nil), // 50: saasapi.BindSetRes - (*BindDeleteRes)(nil), // 51: saasapi.BindDeleteRes - (*BindError)(nil), // 52: saasapi.BindError - (*ScriptRunRes)(nil), // 53: saasapi.ScriptRunRes - (*ScriptInfo)(nil), // 54: saasapi.ScriptInfo - (*ScriptCreateRes)(nil), // 55: saasapi.ScriptCreateRes - (*ScriptListRes)(nil), // 56: saasapi.ScriptListRes - (*ScriptGetRes)(nil), // 57: saasapi.ScriptGetRes - (*ScriptDeleteRes)(nil), // 58: saasapi.ScriptDeleteRes - (*ScriptUseRes)(nil), // 59: saasapi.ScriptUseRes - (*ExpListRes)(nil), // 60: saasapi.ExpListRes - (*ExpBucket)(nil), // 61: saasapi.ExpBucket - (*ExpGetRes)(nil), // 62: saasapi.ExpGetRes - (*ExpData)(nil), // 63: saasapi.ExpData - (*ExpBaseFields)(nil), // 64: saasapi.ExpBaseFields - nil, // 65: saasapi.TargetListRes.TargetListEntry - nil, // 66: saasapi.ExpData.ExtFieldsEntry - nil, // 67: saasapi.ExpData.GroupEntry + (*GrantList)(nil), // 30: saasapi.GrantList + (*Grant)(nil), // 31: saasapi.Grant + (*ScriptRun)(nil), // 32: saasapi.ScriptRun + (*ScriptCreate)(nil), // 33: saasapi.ScriptCreate + (*ScriptList)(nil), // 34: saasapi.ScriptList + (*ScriptDelete)(nil), // 35: saasapi.ScriptDelete + (*ScriptGet)(nil), // 36: saasapi.ScriptGet + (*ScriptUse)(nil), // 37: saasapi.ScriptUse + (*ExpList)(nil), // 38: saasapi.ExpList + (*ExpGet)(nil), // 39: saasapi.ExpGet + (*SaasRes)(nil), // 40: saasapi.SaasRes + (*DataSpace)(nil), // 41: saasapi.DataSpace + (*InfoRes)(nil), // 42: saasapi.InfoRes + (*ReadRes)(nil), // 43: saasapi.ReadRes + (*WriteRes)(nil), // 44: saasapi.WriteRes + (*ValueItem)(nil), // 45: saasapi.ValueItem + (*TaskListRes)(nil), // 46: saasapi.TaskListRes + (*TargetListRes)(nil), // 47: saasapi.TargetListRes + (*TargetCreateRes)(nil), // 48: saasapi.TargetCreateRes + (*TargetDeleteRes)(nil), // 49: saasapi.TargetDeleteRes + (*Binds)(nil), // 50: saasapi.Binds + (*Bind)(nil), // 51: saasapi.Bind + (*BindSetRes)(nil), // 52: saasapi.BindSetRes + (*BindDeleteRes)(nil), // 53: saasapi.BindDeleteRes + (*BindError)(nil), // 54: saasapi.BindError + (*GrantListRes)(nil), // 55: saasapi.GrantListRes + (*ScriptRunRes)(nil), // 56: saasapi.ScriptRunRes + (*ScriptInfo)(nil), // 57: saasapi.ScriptInfo + (*ScriptCreateRes)(nil), // 58: saasapi.ScriptCreateRes + (*ScriptListRes)(nil), // 59: saasapi.ScriptListRes + (*ScriptGetRes)(nil), // 60: saasapi.ScriptGetRes + (*ScriptDeleteRes)(nil), // 61: saasapi.ScriptDeleteRes + (*ScriptUseRes)(nil), // 62: saasapi.ScriptUseRes + (*ExpListRes)(nil), // 63: saasapi.ExpListRes + (*ExpBucket)(nil), // 64: saasapi.ExpBucket + (*ExpGetRes)(nil), // 65: saasapi.ExpGetRes + (*ExpData)(nil), // 66: saasapi.ExpData + (*ExpBaseFields)(nil), // 67: saasapi.ExpBaseFields + nil, // 68: saasapi.TargetListRes.TargetListEntry + nil, // 69: saasapi.ExpData.ExtFieldsEntry + nil, // 70: saasapi.ExpData.GroupEntry } var file_cmd_proto_depIdxs = []int32{ 8, // 0: saasapi.SaasReq.info:type_name -> saasapi.Info @@ -4989,79 +5246,87 @@ var file_cmd_proto_depIdxs = []int32{ 27, // 11: saasapi.SaasReq.target_delete:type_name -> saasapi.TargetDelete 28, // 12: saasapi.SaasReq.bind_set:type_name -> saasapi.BindSet 29, // 13: saasapi.SaasReq.bind_delete:type_name -> saasapi.BindDelete - 30, // 14: saasapi.SaasReq.script_run:type_name -> saasapi.ScriptRun - 31, // 15: saasapi.SaasReq.script_create:type_name -> saasapi.ScriptCreate - 32, // 16: saasapi.SaasReq.script_list:type_name -> saasapi.ScriptList - 33, // 17: saasapi.SaasReq.script_delete:type_name -> saasapi.ScriptDelete - 34, // 18: saasapi.SaasReq.script_get:type_name -> saasapi.ScriptGet - 35, // 19: saasapi.SaasReq.script_use:type_name -> saasapi.ScriptUse - 36, // 20: saasapi.SaasReq.exp_list:type_name -> saasapi.ExpList - 37, // 21: saasapi.SaasReq.exp_get:type_name -> saasapi.ExpGet - 10, // 22: saasapi.Read.read_items:type_name -> saasapi.ReadItem - 12, // 23: saasapi.Write.write_items:type_name -> saasapi.WriteItem - 13, // 24: saasapi.WriteItem.write_bytes:type_name -> saasapi.Bytes - 14, // 25: saasapi.WriteItem.write_uint32s:type_name -> saasapi.Uint32s - 15, // 26: saasapi.WriteItem.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire - 16, // 27: saasapi.FlagsWithExpire.flags_with_expire:type_name -> saasapi.FlagWithExpire - 13, // 28: saasapi.ColumnWrite.write_bytes:type_name -> saasapi.Bytes - 14, // 29: saasapi.ColumnWrite.write_uint32s:type_name -> saasapi.Uint32s - 15, // 30: saasapi.ColumnWrite.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire - 23, // 31: saasapi.Task.task_file_infos:type_name -> saasapi.FileInfo - 4, // 32: saasapi.Task.status:type_name -> saasapi.TaskStatus - 4, // 33: saasapi.TaskList.status_filter:type_name -> saasapi.TaskStatus - 24, // 34: saasapi.FileInfo.file_blocks:type_name -> saasapi.FileBlock - 49, // 35: saasapi.BindSet.binds:type_name -> saasapi.Bind - 49, // 36: saasapi.BindDelete.binds:type_name -> saasapi.Bind - 5, // 37: saasapi.ScriptRun.os:type_name -> saasapi.OS - 2, // 38: saasapi.SaasRes.code:type_name -> saasapi.ErrorCode - 40, // 39: saasapi.SaasRes.info_res:type_name -> saasapi.InfoRes - 41, // 40: saasapi.SaasRes.read_res:type_name -> saasapi.ReadRes - 42, // 41: saasapi.SaasRes.write_res:type_name -> saasapi.WriteRes - 18, // 42: saasapi.SaasRes.task_create_res:type_name -> saasapi.Task - 44, // 43: saasapi.SaasRes.task_list_res:type_name -> saasapi.TaskListRes - 18, // 44: saasapi.SaasRes.task_run_res:type_name -> saasapi.Task - 18, // 45: saasapi.SaasRes.task_delete_res:type_name -> saasapi.Task - 18, // 46: saasapi.SaasRes.task_info_res:type_name -> saasapi.Task - 45, // 47: saasapi.SaasRes.target_list_res:type_name -> saasapi.TargetListRes - 46, // 48: saasapi.SaasRes.target_create_res:type_name -> saasapi.TargetCreateRes - 47, // 49: saasapi.SaasRes.target_delete_res:type_name -> saasapi.TargetDeleteRes - 50, // 50: saasapi.SaasRes.bind_set_res:type_name -> saasapi.BindSetRes - 51, // 51: saasapi.SaasRes.bind_delete_res:type_name -> saasapi.BindDeleteRes - 53, // 52: saasapi.SaasRes.script_run_res:type_name -> saasapi.ScriptRunRes - 55, // 53: saasapi.SaasRes.script_create_res:type_name -> saasapi.ScriptCreateRes - 56, // 54: saasapi.SaasRes.script_list_res:type_name -> saasapi.ScriptListRes - 58, // 55: saasapi.SaasRes.script_delete_res:type_name -> saasapi.ScriptDeleteRes - 57, // 56: saasapi.SaasRes.script_get_res:type_name -> saasapi.ScriptGetRes - 59, // 57: saasapi.SaasRes.script_use_res:type_name -> saasapi.ScriptUseRes - 60, // 58: saasapi.SaasRes.exp_list_res:type_name -> saasapi.ExpListRes - 62, // 59: saasapi.SaasRes.exp_get_res:type_name -> saasapi.ExpGetRes - 39, // 60: saasapi.InfoRes.dataspace:type_name -> saasapi.DataSpace - 43, // 61: saasapi.ReadRes.cmd_res:type_name -> saasapi.ValueItem - 3, // 62: saasapi.ValueItem.cmd_code:type_name -> saasapi.CmdErrorCode - 16, // 63: saasapi.ValueItem.flags_with_expire:type_name -> saasapi.FlagWithExpire - 18, // 64: saasapi.TaskListRes.tasks:type_name -> saasapi.Task - 65, // 65: saasapi.TargetListRes.target_list:type_name -> saasapi.TargetListRes.TargetListEntry - 49, // 66: saasapi.Binds.binds:type_name -> saasapi.Bind - 0, // 67: saasapi.Bind.bind_type:type_name -> saasapi.BindType - 1, // 68: saasapi.Bind.bind_source:type_name -> saasapi.BindSourceType - 52, // 69: saasapi.BindSetRes.errors:type_name -> saasapi.BindError - 52, // 70: saasapi.BindDeleteRes.errors:type_name -> saasapi.BindError - 54, // 71: saasapi.ScriptCreateRes.script_info:type_name -> saasapi.ScriptInfo - 54, // 72: saasapi.ScriptListRes.script_info:type_name -> saasapi.ScriptInfo - 54, // 73: saasapi.ScriptGetRes.script_info:type_name -> saasapi.ScriptInfo - 54, // 74: saasapi.ScriptDeleteRes.script_info:type_name -> saasapi.ScriptInfo - 54, // 75: saasapi.ScriptUseRes.script_info:type_name -> saasapi.ScriptInfo - 61, // 76: saasapi.ExpListRes.buckets:type_name -> saasapi.ExpBucket - 63, // 77: saasapi.ExpGetRes.exp_data:type_name -> saasapi.ExpData - 64, // 78: saasapi.ExpData.base_fields:type_name -> saasapi.ExpBaseFields - 66, // 79: saasapi.ExpData.ext_fields:type_name -> saasapi.ExpData.ExtFieldsEntry - 67, // 80: saasapi.ExpData.group:type_name -> saasapi.ExpData.GroupEntry - 48, // 81: saasapi.TargetListRes.TargetListEntry.value:type_name -> saasapi.Binds - 82, // [82:82] is the sub-list for method output_type - 82, // [82:82] is the sub-list for method input_type - 82, // [82:82] is the sub-list for extension type_name - 82, // [82:82] is the sub-list for extension extendee - 0, // [0:82] is the sub-list for field type_name + 30, // 14: saasapi.SaasReq.grant_list:type_name -> saasapi.GrantList + 31, // 15: saasapi.SaasReq.grant_add:type_name -> saasapi.Grant + 31, // 16: saasapi.SaasReq.grant_delete:type_name -> saasapi.Grant + 32, // 17: saasapi.SaasReq.script_run:type_name -> saasapi.ScriptRun + 33, // 18: saasapi.SaasReq.script_create:type_name -> saasapi.ScriptCreate + 34, // 19: saasapi.SaasReq.script_list:type_name -> saasapi.ScriptList + 35, // 20: saasapi.SaasReq.script_delete:type_name -> saasapi.ScriptDelete + 36, // 21: saasapi.SaasReq.script_get:type_name -> saasapi.ScriptGet + 37, // 22: saasapi.SaasReq.script_use:type_name -> saasapi.ScriptUse + 38, // 23: saasapi.SaasReq.exp_list:type_name -> saasapi.ExpList + 39, // 24: saasapi.SaasReq.exp_get:type_name -> saasapi.ExpGet + 10, // 25: saasapi.Read.read_items:type_name -> saasapi.ReadItem + 12, // 26: saasapi.Write.write_items:type_name -> saasapi.WriteItem + 13, // 27: saasapi.WriteItem.write_bytes:type_name -> saasapi.Bytes + 14, // 28: saasapi.WriteItem.write_uint32s:type_name -> saasapi.Uint32s + 15, // 29: saasapi.WriteItem.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 16, // 30: saasapi.FlagsWithExpire.flags_with_expire:type_name -> saasapi.FlagWithExpire + 13, // 31: saasapi.ColumnWrite.write_bytes:type_name -> saasapi.Bytes + 14, // 32: saasapi.ColumnWrite.write_uint32s:type_name -> saasapi.Uint32s + 15, // 33: saasapi.ColumnWrite.write_flags_with_expire:type_name -> saasapi.FlagsWithExpire + 23, // 34: saasapi.Task.task_file_infos:type_name -> saasapi.FileInfo + 4, // 35: saasapi.Task.status:type_name -> saasapi.TaskStatus + 4, // 36: saasapi.TaskList.status_filter:type_name -> saasapi.TaskStatus + 24, // 37: saasapi.FileInfo.file_blocks:type_name -> saasapi.FileBlock + 51, // 38: saasapi.BindSet.binds:type_name -> saasapi.Bind + 51, // 39: saasapi.BindDelete.binds:type_name -> saasapi.Bind + 5, // 40: saasapi.ScriptRun.os:type_name -> saasapi.OS + 2, // 41: saasapi.SaasRes.code:type_name -> saasapi.ErrorCode + 42, // 42: saasapi.SaasRes.info_res:type_name -> saasapi.InfoRes + 43, // 43: saasapi.SaasRes.read_res:type_name -> saasapi.ReadRes + 44, // 44: saasapi.SaasRes.write_res:type_name -> saasapi.WriteRes + 18, // 45: saasapi.SaasRes.task_create_res:type_name -> saasapi.Task + 46, // 46: saasapi.SaasRes.task_list_res:type_name -> saasapi.TaskListRes + 18, // 47: saasapi.SaasRes.task_run_res:type_name -> saasapi.Task + 18, // 48: saasapi.SaasRes.task_delete_res:type_name -> saasapi.Task + 18, // 49: saasapi.SaasRes.task_info_res:type_name -> saasapi.Task + 47, // 50: saasapi.SaasRes.target_list_res:type_name -> saasapi.TargetListRes + 48, // 51: saasapi.SaasRes.target_create_res:type_name -> saasapi.TargetCreateRes + 49, // 52: saasapi.SaasRes.target_delete_res:type_name -> saasapi.TargetDeleteRes + 52, // 53: saasapi.SaasRes.bind_set_res:type_name -> saasapi.BindSetRes + 53, // 54: saasapi.SaasRes.bind_delete_res:type_name -> saasapi.BindDeleteRes + 55, // 55: saasapi.SaasRes.grant_list_res:type_name -> saasapi.GrantListRes + 31, // 56: saasapi.SaasRes.grant_add_res:type_name -> saasapi.Grant + 31, // 57: saasapi.SaasRes.grant_delete_res:type_name -> saasapi.Grant + 56, // 58: saasapi.SaasRes.script_run_res:type_name -> saasapi.ScriptRunRes + 58, // 59: saasapi.SaasRes.script_create_res:type_name -> saasapi.ScriptCreateRes + 59, // 60: saasapi.SaasRes.script_list_res:type_name -> saasapi.ScriptListRes + 61, // 61: saasapi.SaasRes.script_delete_res:type_name -> saasapi.ScriptDeleteRes + 60, // 62: saasapi.SaasRes.script_get_res:type_name -> saasapi.ScriptGetRes + 62, // 63: saasapi.SaasRes.script_use_res:type_name -> saasapi.ScriptUseRes + 63, // 64: saasapi.SaasRes.exp_list_res:type_name -> saasapi.ExpListRes + 65, // 65: saasapi.SaasRes.exp_get_res:type_name -> saasapi.ExpGetRes + 41, // 66: saasapi.InfoRes.dataspace:type_name -> saasapi.DataSpace + 45, // 67: saasapi.ReadRes.cmd_res:type_name -> saasapi.ValueItem + 3, // 68: saasapi.ValueItem.cmd_code:type_name -> saasapi.CmdErrorCode + 16, // 69: saasapi.ValueItem.flags_with_expire:type_name -> saasapi.FlagWithExpire + 18, // 70: saasapi.TaskListRes.tasks:type_name -> saasapi.Task + 68, // 71: saasapi.TargetListRes.target_list:type_name -> saasapi.TargetListRes.TargetListEntry + 51, // 72: saasapi.Binds.binds:type_name -> saasapi.Bind + 0, // 73: saasapi.Bind.bind_type:type_name -> saasapi.BindType + 1, // 74: saasapi.Bind.bind_source:type_name -> saasapi.BindSourceType + 54, // 75: saasapi.BindSetRes.errors:type_name -> saasapi.BindError + 54, // 76: saasapi.BindDeleteRes.errors:type_name -> saasapi.BindError + 31, // 77: saasapi.GrantListRes.from:type_name -> saasapi.Grant + 31, // 78: saasapi.GrantListRes.to:type_name -> saasapi.Grant + 57, // 79: saasapi.ScriptCreateRes.script_info:type_name -> saasapi.ScriptInfo + 57, // 80: saasapi.ScriptListRes.script_info:type_name -> saasapi.ScriptInfo + 57, // 81: saasapi.ScriptGetRes.script_info:type_name -> saasapi.ScriptInfo + 57, // 82: saasapi.ScriptDeleteRes.script_info:type_name -> saasapi.ScriptInfo + 57, // 83: saasapi.ScriptUseRes.script_info:type_name -> saasapi.ScriptInfo + 64, // 84: saasapi.ExpListRes.buckets:type_name -> saasapi.ExpBucket + 66, // 85: saasapi.ExpGetRes.exp_data:type_name -> saasapi.ExpData + 67, // 86: saasapi.ExpData.base_fields:type_name -> saasapi.ExpBaseFields + 69, // 87: saasapi.ExpData.ext_fields:type_name -> saasapi.ExpData.ExtFieldsEntry + 70, // 88: saasapi.ExpData.group:type_name -> saasapi.ExpData.GroupEntry + 50, // 89: saasapi.TargetListRes.TargetListEntry.value:type_name -> saasapi.Binds + 90, // [90:90] is the sub-list for method output_type + 90, // [90:90] is the sub-list for method input_type + 90, // [90:90] is the sub-list for extension type_name + 90, // [90:90] is the sub-list for extension extendee + 0, // [0:90] is the sub-list for field type_name } func init() { file_cmd_proto_init() } @@ -5084,6 +5349,9 @@ func file_cmd_proto_init() { (*SaasReq_TargetDelete)(nil), (*SaasReq_BindSet)(nil), (*SaasReq_BindDelete)(nil), + (*SaasReq_GrantList)(nil), + (*SaasReq_GrantAdd)(nil), + (*SaasReq_GrantDelete)(nil), (*SaasReq_ScriptRun)(nil), (*SaasReq_ScriptCreate)(nil), (*SaasReq_ScriptList)(nil), @@ -5093,7 +5361,7 @@ func file_cmd_proto_init() { (*SaasReq_ExpList)(nil), (*SaasReq_ExpGet)(nil), } - file_cmd_proto_msgTypes[31].OneofWrappers = []any{ + file_cmd_proto_msgTypes[33].OneofWrappers = []any{ (*SaasRes_InfoRes)(nil), (*SaasRes_ReadRes)(nil), (*SaasRes_WriteRes)(nil), @@ -5107,6 +5375,9 @@ func file_cmd_proto_init() { (*SaasRes_TargetDeleteRes)(nil), (*SaasRes_BindSetRes)(nil), (*SaasRes_BindDeleteRes)(nil), + (*SaasRes_GrantListRes)(nil), + (*SaasRes_GrantAddRes)(nil), + (*SaasRes_GrantDeleteRes)(nil), (*SaasRes_ScriptRunRes)(nil), (*SaasRes_ScriptCreateRes)(nil), (*SaasRes_ScriptListRes)(nil), @@ -5122,7 +5393,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: 7, - NumMessages: 61, + NumMessages: 64, NumExtensions: 0, NumServices: 0, }, diff --git a/cmd.proto b/cmd.proto index 6f0a08c..ef7c940 100644 --- a/cmd.proto +++ b/cmd.proto @@ -26,6 +26,10 @@ message SaasReq { BindSet bind_set = 61; // 设置绑定 BindDelete bind_delete = 62; // 解除绑定 + GrantList grant_list = 70; // 列出数据授权 + Grant grant_add = 71; // 增加数据授权 + Grant grant_delete = 72; // 删除数据授权 + ScriptRun script_run = 90; // 运行脚本 ScriptCreate script_create = 91; // 脚本创建 ScriptList script_list = 92; // 列出脚本 @@ -186,6 +190,17 @@ message BindDelete { repeated Bind binds = 2; // 解除绑定内容 } +// GrantList 列出数据授权 +message GrantList { +} + +// Grant 数据授权信息 +message Grant { + uint32 srta_account_id = 1; // sRTA授权目标账号ID + string grant_index = 2; // 授权索引。格式为 "index1, index2, index55-index64",例如 "1, 2, 55-64" +} + + // ScriptRun 运行脚本 message ScriptRun { string lua_script = 1; // 要调试的lua脚本 @@ -267,6 +282,10 @@ message SaasRes { BindSetRes bind_set_res = 61; // 设置绑定返回状态 BindDeleteRes bind_delete_res = 62; // 删除绑定返回状态 + GrantListRes grant_list_res = 70; // 列出数据授权返回状态 + Grant grant_add_res = 71; // 增加数据授权返回状态 + Grant grant_delete_res = 72; // 删除数据授权返回状态 + ScriptRunRes script_run_res = 90; // 运行脚本返回 ScriptCreateRes script_create_res = 91; // 创建脚本返回 ScriptListRes script_list_res = 92; // 列出脚本返回 @@ -389,6 +408,11 @@ message BindError { string reason = 3; // 错误绑定原因 } +// GrantListRes 授权列表返回 +message GrantListRes { + repeated Grant from = 1; // 被授权列表 + repeated Grant to = 2; // 向外授权列表 +} // ScriptRunRes 运行脚本返回 message ScriptRunRes { diff --git a/cmd/saastool/grant.go b/cmd/saastool/grant.go new file mode 100644 index 0000000..6f95264 --- /dev/null +++ b/cmd/saastool/grant.go @@ -0,0 +1,46 @@ +package main + +import ( + "fmt" + "os" + "strings" +) + +func RunGrant(args ...string) error { + name, args := ParseCommandName(args) + + // 从参数中解析出命令 + switch name { + case "", "help": + return RunGrantHelp(args...) + case "list": + return RunGrantList(args...) + case "add": + return RunGrantAdd(args...) + case "delete": + return RunGrantDelete(args...) + default: + err := fmt.Errorf(`unknown command "%s"`+"\n"+`Run 'saastool grant help' for usage`, name) + fmt.Fprintln(os.Stderr, err) + + return err + } +} + +func RunGrantHelp(args ...string) error { + fmt.Println(strings.TrimSpace(grantUsage)) + return nil +} + +const grantUsage = ` +Usage: saastool grant COMMAND [OPTIONS] + +Commands: + list List data grants + add Add data grant + delete Delete data grant + +"help" is the default command. + +Use "saastool grant COMMAND -help" for more information about a command. +` diff --git a/cmd/saastool/grant_add.go b/cmd/saastool/grant_add.go new file mode 100644 index 0000000..9920801 --- /dev/null +++ b/cmd/saastool/grant_add.go @@ -0,0 +1,91 @@ +package main + +import ( + "flag" + "fmt" + "net/http" + "os" + + "git.algo.com.cn/public/saasapi" + "git.algo.com.cn/public/saasapi/pkg/saashttp" + "google.golang.org/protobuf/encoding/protojson" +) + +type grantAddParams struct { + srtaAccountId uint32 + grantIndex string + saasHttp *saashttp.SaasClient +} + +func RunGrantAdd(args ...string) error { + fs := flag.NewFlagSet("add", flag.ExitOnError) + cfgFile := paramConfig(fs) + srtaAccountId := paramSrtaAccountId(fs) + grantIndex := paramGrantIndex(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 + } + + if *srtaAccountId == 0 { + fmt.Fprintln(os.Stderr, "Error: sRTA account ID is required") + fs.PrintDefaults() + return fmt.Errorf("sRTA account ID is required") + } + + if *grantIndex == "" { + fmt.Fprintln(os.Stderr, "Error: grant index is required") + fs.PrintDefaults() + return fmt.Errorf("grant index is required") + } + + cfg, err := LoadConfigFile(*cfgFile) + if err != nil { + fmt.Fprintln(os.Stderr, "LoadConfigFile error", "err", err) + return err + } + + grantAddParams := grantAddParams{ + srtaAccountId: uint32(*srtaAccountId), + grantIndex: *grantIndex, + saasHttp: &saashttp.SaasClient{ + Client: &http.Client{}, + ApiUrls: saashttp.InitAPIUrl(&cfg.ApiUrls), + Auth: &cfg.Auth, + }, + } + + return doGrantAdd(grantAddParams) +} + +func doGrantAdd(params grantAddParams) error { + saasReq := &saasapi.SaasReq{ + Cmd: &saasapi.SaasReq_GrantAdd{ + GrantAdd: &saasapi.Grant{ + SrtaAccountId: params.srtaAccountId, + GrantIndex: params.grantIndex, + }, + }, + } + + res, err := params.saasHttp.GrantAdd(saasReq) + if err != nil { + fmt.Fprintln(os.Stderr, "submit Grant Add error", "err", err) + return err + } + + if res.Code != saasapi.ErrorCode_SUCC { + fmt.Fprintln(os.Stderr, "Grant add failed", "code", res.Code, "status", res.Status) + return nil + } + + grantRes := res.GetGrantAddRes() + fmt.Printf("grant add res: %v\n", protojson.Format(grantRes)) + return nil +} diff --git a/cmd/saastool/grant_delete.go b/cmd/saastool/grant_delete.go new file mode 100644 index 0000000..db85ae8 --- /dev/null +++ b/cmd/saastool/grant_delete.go @@ -0,0 +1,91 @@ +package main + +import ( + "flag" + "fmt" + "net/http" + "os" + + "git.algo.com.cn/public/saasapi" + "git.algo.com.cn/public/saasapi/pkg/saashttp" + "google.golang.org/protobuf/encoding/protojson" +) + +type grantDeleteParams struct { + srtaAccountId uint32 + grantIndex string + saasHttp *saashttp.SaasClient +} + +func RunGrantDelete(args ...string) error { + fs := flag.NewFlagSet("delete", flag.ExitOnError) + cfgFile := paramConfig(fs) + srtaAccountId := paramSrtaAccountId(fs) + grantIndex := paramGrantIndex(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 + } + + if *srtaAccountId == 0 { + fmt.Fprintln(os.Stderr, "Error: sRTA account ID is required") + fs.PrintDefaults() + return fmt.Errorf("sRTA account ID is required") + } + + if *grantIndex == "" { + fmt.Fprintln(os.Stderr, "Error: grant index is required") + fs.PrintDefaults() + return fmt.Errorf("grant index is required") + } + + cfg, err := LoadConfigFile(*cfgFile) + if err != nil { + fmt.Fprintln(os.Stderr, "LoadConfigFile error", "err", err) + return err + } + + grantDeleteParams := grantDeleteParams{ + srtaAccountId: uint32(*srtaAccountId), + grantIndex: *grantIndex, + saasHttp: &saashttp.SaasClient{ + Client: &http.Client{}, + ApiUrls: saashttp.InitAPIUrl(&cfg.ApiUrls), + Auth: &cfg.Auth, + }, + } + + return doGrantDelete(grantDeleteParams) +} + +func doGrantDelete(params grantDeleteParams) error { + saasReq := &saasapi.SaasReq{ + Cmd: &saasapi.SaasReq_GrantDelete{ + GrantDelete: &saasapi.Grant{ + SrtaAccountId: params.srtaAccountId, + GrantIndex: params.grantIndex, + }, + }, + } + + res, err := params.saasHttp.GrantDelete(saasReq) + if err != nil { + fmt.Fprintln(os.Stderr, "submit Grant Delete error", "err", err) + return err + } + + if res.Code != saasapi.ErrorCode_SUCC { + fmt.Fprintln(os.Stderr, "Grant delete failed", "code", res.Code, "status", res.Status) + return nil + } + + grantRes := res.GetGrantDeleteRes() + fmt.Printf("grant delete res: %v\n", protojson.Format(grantRes)) + return nil +} diff --git a/cmd/saastool/grant_list.go b/cmd/saastool/grant_list.go new file mode 100644 index 0000000..8d9c493 --- /dev/null +++ b/cmd/saastool/grant_list.go @@ -0,0 +1,70 @@ +package main + +import ( + "flag" + "fmt" + "net/http" + "os" + + "git.algo.com.cn/public/saasapi" + "git.algo.com.cn/public/saasapi/pkg/saashttp" + "google.golang.org/protobuf/encoding/protojson" +) + +type grantListParams struct { + saasHttp *saashttp.SaasClient +} + +func RunGrantList(args ...string) error { + fs := flag.NewFlagSet("list", 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 + } + + grantListParams := grantListParams{ + saasHttp: &saashttp.SaasClient{ + Client: &http.Client{}, + ApiUrls: saashttp.InitAPIUrl(&cfg.ApiUrls), + Auth: &cfg.Auth, + }, + } + + return doGrantList(grantListParams) +} + +func doGrantList(params grantListParams) error { + saasReq := &saasapi.SaasReq{ + Cmd: &saasapi.SaasReq_GrantList{ + GrantList: &saasapi.GrantList{}, + }, + } + + res, err := params.saasHttp.GrantList(saasReq) + if err != nil { + fmt.Fprintln(os.Stderr, "submit Grant List error", "err", err) + return err + } + + if res.Code != saasapi.ErrorCode_SUCC { + fmt.Fprintln(os.Stderr, "Grant list failed", "code", res.Code, "status", res.Status) + return nil + } + + grantRes := res.GetGrantListRes() + fmt.Printf("grant list res: %v\n", protojson.Format(grantRes)) + return nil +} diff --git a/cmd/saastool/help.go b/cmd/saastool/help.go index 60273be..843371b 100644 --- a/cmd/saastool/help.go +++ b/cmd/saastool/help.go @@ -25,6 +25,7 @@ Commands: task Task commands target Target commands bind Bind commands + grant Grant commands script Script commands exp Exp commands diff --git a/cmd/saastool/main.go b/cmd/saastool/main.go index 9753832..108af76 100644 --- a/cmd/saastool/main.go +++ b/cmd/saastool/main.go @@ -36,6 +36,8 @@ func Run(args ...string) error { return RunTarget(args...) case "bind": return RunBind(args...) + case "grant": + return RunGrant(args...) case "script": return RunScript(args...) case "exp": diff --git a/cmd/saastool/params.go b/cmd/saastool/params.go index 4df7066..f8b355d 100644 --- a/cmd/saastool/params.go +++ b/cmd/saastool/params.go @@ -153,6 +153,14 @@ func paramTotalFlag(fs *flag.FlagSet) *bool { return fs.Bool("total", false, "Total flag") } +func paramSrtaAccountId(fs *flag.FlagSet) *uint64 { + return fs.Uint64("account", 0, "sRTA account ID") +} + +func paramGrantIndex(fs *flag.FlagSet) *string { + return fs.String("index", "", "Grant index. Format: \"index1, index2, index55-index64\"") +} + // ParseByteSize 解析字节大小字符串为字节数 func ParseByteSize(sizeStr string) (uint64, error) { sizeStr = strings.TrimSpace(sizeStr) diff --git a/pkg/saashttp/cfg.go b/pkg/saashttp/cfg.go index 2726099..adbe04c 100644 --- a/pkg/saashttp/cfg.go +++ b/pkg/saashttp/cfg.go @@ -26,6 +26,9 @@ const ( scriptUsePath = "/saas/script/use" expListPath = "/saas/exp/list" expGetPath = "/saas/exp/get" + grantListPath = "/saas/grant/list" + grantAddPath = "/saas/grant/add" + grantDeletePath = "/saas/grant/delete" ) type Auth struct { @@ -59,6 +62,9 @@ type ApiUrls struct { ScriptUsePath string ExpListPath string ExpGetPath string + GrantListPath string + GrantAddPath string + GrantDeletePath string } func InitAPIUrl(c *ApiUrls) *ApiUrls { @@ -198,5 +204,23 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls { r.ExpGetPath = expGetPath } + if c.GrantListPath != "" { + r.GrantListPath = c.GrantListPath + } else { + r.GrantListPath = grantListPath + } + + if c.GrantAddPath != "" { + r.GrantAddPath = c.GrantAddPath + } else { + r.GrantAddPath = grantAddPath + } + + if c.GrantDeletePath != "" { + r.GrantDeletePath = c.GrantDeletePath + } else { + r.GrantDeletePath = grantDeletePath + } + return r } diff --git a/pkg/saashttp/httpcli.go b/pkg/saashttp/httpcli.go index 148cd22..79d6b1e 100644 --- a/pkg/saashttp/httpcli.go +++ b/pkg/saashttp/httpcli.go @@ -128,6 +128,21 @@ func (c *SaasClient) ExpGet(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, return c.post(postUrl, saasReq) } +func (c *SaasClient) GrantList(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) { + postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.GrantListPath) + return c.post(postUrl, saasReq) +} + +func (c *SaasClient) GrantAdd(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) { + postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.GrantAddPath) + return c.post(postUrl, saasReq) +} + +func (c *SaasClient) GrantDelete(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) { + postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.GrantDeletePath) + return c.post(postUrl, saasReq) +} + func (c *SaasClient) makeUrl(baseUrl, path string, params ...string) string { url, err := url.Parse(baseUrl) if err != nil {