handlers

package
v0.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package handlers implements the API server interface with request handlers for the CBT API.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidModelID = fiber.NewError(fiber.StatusBadRequest, "invalid model ID format, expected database.table")

ErrInvalidModelID is returned when an invalid model ID format is provided

View Source
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

func (s *Server) GetExternalBounds(c fiber.Ctx, id string) error

GetExternalBounds handles GET /api/v1/models/external/{id}/bounds

func (*Server) GetExternalModel

func (s *Server) GetExternalModel(c fiber.Ctx, id string) error

GetExternalModel handles GET /api/v1/models/external/{id}

func (*Server) GetIntervalTypes

func (s *Server) GetIntervalTypes(c fiber.Ctx) error

GetIntervalTypes returns the configured interval type transformations GET /api/v1/interval/types

func (*Server) GetScheduledRun

func (s *Server) GetScheduledRun(c fiber.Ctx, id string) error

GetScheduledRun handles GET /api/v1/models/transformations/{id}/runs

func (*Server) GetTransformation

func (s *Server) GetTransformation(c fiber.Ctx, id string) error

GetTransformation handles GET /api/v1/models/transformations/{id}

func (*Server) GetTransformationCoverage

func (s *Server) GetTransformationCoverage(c fiber.Ctx, id string) error

GetTransformationCoverage handles GET /api/v1/models/transformations/{id}/coverage

func (*Server) ListAllModels

func (s *Server) ListAllModels(c fiber.Ctx, params generated.ListAllModelsParams) error

ListAllModels handles GET /api/v1/models

func (*Server) ListExternalBounds

func (s *Server) ListExternalBounds(c fiber.Ctx) error

ListExternalBounds handles GET /api/v1/models/external/bounds

func (*Server) ListExternalModels

func (s *Server) ListExternalModels(c fiber.Ctx, params generated.ListExternalModelsParams) error

ListExternalModels handles GET /api/v1/models/external

func (*Server) ListScheduledRuns

func (s *Server) ListScheduledRuns(c fiber.Ctx, params generated.ListScheduledRunsParams) error

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

func (s *Server) ListTransformations(c fiber.Ctx, params generated.ListTransformationsParams) error

ListTransformations handles GET /api/v1/models/transformations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL