Updated Panic API on cores

This commit is contained in:
porosnicuadrian
2022-04-26 09:26:47 +03:00
committed by Dan Christian Bogos
parent bc5f1b5e10
commit 51e4159be0
3 changed files with 14 additions and 8 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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