api

package
v0.0.0-...-7e92bb9 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package api exposes read-only JSON endpoints for dashboards and automation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(store Store, m *metrics.Metrics, logger *slog.Logger, defaults Config) http.Handler

NewHandler returns the API routes. HTTP server timeouts are the caller's responsibility.

Types

type Config

type Config struct {
	DefaultTenantID    string
	DefaultAccountID   string
	DefaultWindowDays  int
	MinObservationDays int
	AuthToken          string
}

Config supplies query defaults when request parameters are omitted.

type Store

type Store interface {
	Ping(context.Context) error
	QueryPermissionUsage(context.Context, storage.UsageQuery) ([]storage.PermissionUsage, error)
	GetCollectorCoverage(context.Context, time.Time) (storage.CollectorCoverage, error)
	LatestIAMSnapshot(context.Context, string) (storage.IAMSnapshot, bool, error)
}

Store is the storage surface used by the query API.

Jump to

Keyboard shortcuts

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