MCPcopy Create free account
hub / github.com/astercloud/aster / DeleteEval

Method DeleteEval

server/handlers/eval.go:368–398  ·  view source on GitHub ↗

DeleteEval deletes an evaluation

(c *gin.Context)

Source from the content-addressed store, hash-verified

366
367// DeleteEval deletes an evaluation
368func (h *EvalHandler) DeleteEval(c *gin.Context) {
369 ctx := c.Request.Context()
370 id := c.Param("id")
371
372 if err := (*h.store).Delete(ctx, "evals", id); err != nil {
373 if errors.Is(err, store.ErrNotFound) {
374 c.JSON(http.StatusNotFound, gin.H{
375 "success": false,
376 "error": gin.H{
377 "code": "not_found",
378 "message": "Evaluation not found",
379 },
380 })
381 return
382 }
383 c.JSON(http.StatusInternalServerError, gin.H{
384 "success": false,
385 "error": gin.H{
386 "code": "internal_error",
387 "message": err.Error(),
388 },
389 })
390 return
391 }
392
393 logging.Info(ctx, "eval.deleted", map[string]any{
394 "id": id,
395 })
396
397 c.Status(http.StatusNoContent)
398}
399
400// CreateBenchmark creates a benchmark
401func (h *EvalHandler) CreateBenchmark(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

InfoFunction · 0.92
JSONMethod · 0.80
ContextMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected