api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package api is the read/replay JSON API consumed by the embedded UI and by curl. Everything under /api requires the bearer token; /healthz and the static UI assets do not (the UI asks for the token client-side).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveTargets

func ResolveTargets(cfg *config.Config, source, explicit string) ([]string, error)

ResolveTargets decides where a replay goes: the explicit target if given, otherwise the source's currently configured targets. A source that is no longer in the config requires an explicit target — no guessing.

Types

type Handler

type Handler struct {
	Store *store.Store
	Cfg   *config.Config
	Token []byte // bearer token for /api
	UI    fs.FS  // built SPA; nil disables static serving
	Log   *slog.Logger
}

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

Register mounts API routes, healthz and the SPA on mux.

Jump to

Keyboard shortcuts

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