endpoints

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package endpoints provides external HTTP API endpoints for accessing observability data. The API supports Prometheus queries, historical data analysis, resource efficiency metrics, and subscription management. All endpoints are protected by configurable security layers including authentication, rate limiting, request validation, and audit logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled    bool                      `json:"enabled" yaml:"enabled"`
	Port       int                       `json:"port" yaml:"port"`
	AuthToken  string                    `json:"auth_token" yaml:"authToken"`
	RateLimit  security.RateLimitConfig  `json:"rate_limit" yaml:"rateLimit"`
	Validation security.ValidationConfig `json:"validation" yaml:"validation"`
	Audit      security.AuditConfig      `json:"audit" yaml:"audit"`
}

Config for external API

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default API configuration

type ExternalAPI

type ExternalAPI struct {
	// contains filtered or unexported fields
}

ExternalAPI provides HTTP API endpoints for external access to observability data

func NewExternalAPI

func NewExternalAPI(
	client *prometheus.CachedClient,
	subscriptionMgr *subscription.SubscriptionManager,
	historicalCollector *historical.HistoricalDataCollector,
	historicalAnalyzer *historical.HistoricalAnalyzer,
	efficiencyAnalyzer *analysis.ResourceEfficiencyAnalyzer,
	config *Config,
) *ExternalAPI

NewExternalAPI creates a new external API instance

func (*ExternalAPI) Start

func (api *ExternalAPI) Start(_ context.Context) error

Start starts the external API server

func (*ExternalAPI) Stop

func (api *ExternalAPI) Stop(ctx context.Context) error

Stop stops the external API server

Jump to

Keyboard shortcuts

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