From 51e4159be0a66ab612a09f91ab24d6b9312bc221 Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Tue, 26 Apr 2022 09:26:47 +0300 Subject: [PATCH] Updated Panic API on cores --- apis/cores.go | 11 +++-------- cores/core.go | 5 +++++ utils/coreutils.go | 6 ++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apis/cores.go b/apis/cores.go index 8f89e2d09..846fbd210 100644 --- a/apis/cores.go +++ b/apis/cores.go @@ -68,12 +68,7 @@ func (cS *CoreSv1) StopMemoryProfiling(ctx *context.Context, args *utils.TenantW return cS.cS.V1StopMemoryProfiling(ctx, args, reply) } -type PanicMessageArgs struct { - Tenant string - APIOpts map[string]interface{} - Message string -} - -func (cS *CoreSv1) Panic(args *PanicMessageArgs, _ *string) error { - panic(args.Message) +// Panic is used print the Message sent as a panic +func (cS *CoreSv1) Panic(ctx *context.Context, args *utils.PanicMessageArgs, reply *string) error { + return cS.cS.V1Panic(ctx, args, reply) } diff --git a/cores/core.go b/cores/core.go index 14e03e7b3..1028915b0 100644 --- a/cores/core.go +++ b/cores/core.go @@ -258,3 +258,8 @@ func (cS *CoreS) V1StopMemoryProfiling(_ *context.Context, _ *utils.TenantWithAP *reply = utils.OK return nil } + +// V1Panic is used print the Message sent as a panic +func (cS *CoreS) V1Panic(_ *context.Context, args *utils.PanicMessageArgs, _ *string) error { + panic(args.Message) +} diff --git a/utils/coreutils.go b/utils/coreutils.go index df19b4ba1..e39fb6a9f 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -780,6 +780,12 @@ type MemoryPrf struct { APIOpts map[string]interface{} } +type PanicMessageArgs struct { + Tenant string + APIOpts map[string]interface{} + Message string +} + // SetIndexesArg the API arguments needed for seting an index type SetIndexesArg struct { IdxItmType string