api

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: GPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, 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