eval.go

Overview

This source file defines the EvalAPIRouter struct and its associated method Routes(), which specifies HTTP routes related to evaluation functionalities within the application. The router maps URL endpoints to HTTP methods and handler functions used for managing evaluation sets and evaluation results. However, the actual handler implementations are placeholders marked as unimplemented in the linked controllers.

The file plays a role in the API routing layer, specifically for evaluation-related endpoints, and integrates with the REST API server by providing route definitions that the HTTP router can register and serve.


Types and Functions

EvalAPIRouter Struct

(r *EvalAPIRouter) Routes() Routes

router := &EvalAPIRouter{}
routes := router.Routes()
// Register routes with HTTP server mux

Implementation Details


Interaction with Other System Components


Diagram: EvalAPIRouter Route Structure

flowchart TD
EvalAPIRouter --> Routes
Routes --> Route1[ListEvalSets GET /apps/{app_name}/eval_sets]
Routes --> Route2[ListEvalSets POST, OPTIONS /apps/{app_name}/eval_sets/{eval_set_name}]
Routes --> Route3[ListEvalResults GET /apps/{app_name}/eval_results]
Route1 --> Handler1[controllers.Unimplemented]
Route2 --> Handler2[controllers.Unimplemented]
Route3 --> Handler3[controllers.Unimplemented]

This flowchart shows the EvalAPIRouter providing a collection of routes, each mapped to an unimplemented handler function from the controllers package.


References