api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package api provides a REST API layer for exposing model metadata and transformation state.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPIAddrRequired = errors.New("api address is required when API is enabled")
)

ErrAPIAddrRequired is returned when API is enabled but no address is configured

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled bool   `yaml:"enabled" default:"false"`
	Addr    string `yaml:"addr" default:":8080" validate:"hostname_port"`
}

Config represents API service configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the API configuration

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop() error
}

Service defines the API service interface

func NewService

func NewService(
	cfg *Config,
	modelsService models.Service,
	adminService admin.Service,
	intervalTypes handlers.IntervalTypesConfig,
	frontendHandler http.Handler,
	mgmtService management.Service,
	log logrus.FieldLogger,
) Service

NewService creates a new API and frontend service

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.
Package handlers implements the API server interface with request handlers for the CBT API.
Package handlers implements the API server interface with request handlers for the CBT API.

Jump to

Keyboard shortcuts

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