Documentation
¶
Overview ¶
Package handlers implements the API server interface with request handlers for the CBT API.
Index ¶
- Variables
- type IntervalTypeTransformation
- type IntervalTypesConfig
- type Server
- func (s *Server) GetExternalBounds(c fiber.Ctx, id string) error
- func (s *Server) GetExternalModel(c fiber.Ctx, id string) error
- func (s *Server) GetIntervalTypes(c fiber.Ctx) error
- func (s *Server) GetScheduledRun(c fiber.Ctx, id string) error
- func (s *Server) GetTransformation(c fiber.Ctx, id string) error
- func (s *Server) GetTransformationCoverage(c fiber.Ctx, id string) error
- func (s *Server) ListAllModels(c fiber.Ctx, params generated.ListAllModelsParams) error
- func (s *Server) ListExternalBounds(c fiber.Ctx) error
- func (s *Server) ListExternalModels(c fiber.Ctx, params generated.ListExternalModelsParams) error
- func (s *Server) ListScheduledRuns(c fiber.Ctx, params generated.ListScheduledRunsParams) error
- func (s *Server) ListTransformationCoverage(c fiber.Ctx, params generated.ListTransformationCoverageParams) error
- func (s *Server) ListTransformations(c fiber.Ctx, params generated.ListTransformationsParams) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidModelID = fiber.NewError(fiber.StatusBadRequest, "invalid model ID format, expected database.table")
ErrInvalidModelID is returned when an invalid model ID format is provided
var ErrModelNotFound = fiber.NewError(fiber.StatusNotFound, "model not found")
ErrModelNotFound is returned when a model is not found
Functions ¶
This section is empty.
Types ¶
type IntervalTypeTransformation ¶
type IntervalTypeTransformation struct {
Name string `json:"name"` // Display name (e.g., "timestamp", "epoch")
Expression string `json:"expression,omitempty"` // Optional CEL expression (e.g., "math.floor(value / 12)")
Format string `json:"format,omitempty"` // Optional display format hint (e.g., "datetime", "date", "time")
}
IntervalTypeTransformation represents a single transformation step for an interval type
type IntervalTypesConfig ¶
type IntervalTypesConfig map[string][]IntervalTypeTransformation
IntervalTypesConfig maps interval type names to their transformation pipelines
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the generated.ServerInterface
func NewServer ¶
func NewServer(modelsService models.Service, adminService admin.Service, intervalTypes IntervalTypesConfig, log logrus.FieldLogger) *Server
NewServer creates a new API server instance
func (*Server) GetExternalBounds ¶
GetExternalBounds handles GET /api/v1/models/external/{id}/bounds
func (*Server) GetExternalModel ¶
GetExternalModel handles GET /api/v1/models/external/{id}
func (*Server) GetIntervalTypes ¶
GetIntervalTypes returns the configured interval type transformations GET /api/v1/interval/types
func (*Server) GetScheduledRun ¶
GetScheduledRun handles GET /api/v1/models/transformations/{id}/runs
func (*Server) GetTransformation ¶
GetTransformation handles GET /api/v1/models/transformations/{id}
func (*Server) GetTransformationCoverage ¶
GetTransformationCoverage handles GET /api/v1/models/transformations/{id}/coverage
func (*Server) ListAllModels ¶
ListAllModels handles GET /api/v1/models
func (*Server) ListExternalBounds ¶
ListExternalBounds handles GET /api/v1/models/external/bounds
func (*Server) ListExternalModels ¶
ListExternalModels handles GET /api/v1/models/external
func (*Server) ListScheduledRuns ¶
ListScheduledRuns handles GET /api/v1/models/transformations/runs
func (*Server) ListTransformationCoverage ¶
func (s *Server) ListTransformationCoverage(c fiber.Ctx, params generated.ListTransformationCoverageParams) error
ListTransformationCoverage handles GET /api/v1/models/transformations/coverage
func (*Server) ListTransformations ¶
ListTransformations handles GET /api/v1/models/transformations