httpapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package httpapi provides an optional HTTP transport adapter for agentwatch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(mon *monitor.Monitor, opts ...Option) (http.Handler, error)

NewHandler returns an http.Handler that serves the agentwatch HTTP API. Routes:

GET /sessions       — list all sessions (Snapshot)
GET /sessions/{id}  — single session by ID (404 if not found)
GET /healthz        — source health status
GET /sources        — registered source names

All responses are JSON with Content-Type: application/json. The optional privacy policy is applied to every session response.

Types

type Option

type Option func(*handler)

Option configures a Handler.

func WithPolicy

func WithPolicy(p session.Policy) Option

WithPolicy sets the privacy policy applied to all session responses. A zero-value Policy is a pass-through — nothing is redacted.

Jump to

Keyboard shortcuts

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