Documentation
¶
Index ¶
- func CreateScenario(s store.Store) http.HandlerFunc
- func CreateSession(s store.Store) http.HandlerFunc
- func DeleteScenario(s store.Store) http.HandlerFunc
- func DeleteSession(s store.Store) http.HandlerFunc
- func Feedback(s store.Store) http.HandlerFunc
- func GetLog(s store.Store) http.HandlerFunc
- func GetScenario(s store.Store) http.HandlerFunc
- func GetWebhook(s store.Store) http.HandlerFunc
- func GetWebhookStatus(s store.Store) http.HandlerFunc
- func GetWorkspace(s store.Store) http.HandlerFunc
- func Healthz() http.HandlerFunc
- func ListGateways(reg *adapters.Registry) http.HandlerFunc
- func ListLogs(s store.Store) http.HandlerFunc
- func ListScenarios(s store.Store) http.HandlerFunc
- func ListWebhooks(s store.Store) http.HandlerFunc
- func Login(s store.Store, jwtSecret, mode string) http.HandlerFunc
- func Logout(mode string) http.HandlerFunc
- func Me(s store.Store) http.HandlerFunc
- func NewMock(eng *engine.Engine, reg *adapters.Registry, s store.Store, ...) http.Handler
- func NewMockWithMode(eng *engine.Engine, reg *adapters.Registry, s store.Store, ...) http.Handler
- func ReplayLog(s store.Store, eng *engine.Engine, reg *adapters.Registry, ...) http.HandlerFunc
- func RunScenario(s store.Store, eng *engine.Engine, reg *adapters.Registry, ...) http.HandlerFunc
- func Signup(s store.Store, jwtSecret, mode string) http.HandlerFunc
- func TestWebhook(d *webhook.Dispatcher) http.HandlerFunc
- func UpdateScenario(s store.Store) http.HandlerFunc
- func UpdateWorkspace(s store.Store) http.HandlerFunc
- func WorkspaceFromRequest(r *http.Request, s store.Store) (*store.Workspace, error)
- func WorkspaceIDFromRequest(r *http.Request, s store.Store) string
- type MockHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateScenario ¶
func CreateScenario(s store.Store) http.HandlerFunc
func CreateSession ¶
func CreateSession(s store.Store) http.HandlerFunc
func DeleteScenario ¶
func DeleteScenario(s store.Store) http.HandlerFunc
func DeleteSession ¶
func DeleteSession(s store.Store) http.HandlerFunc
func Feedback ¶ added in v1.2.0
func Feedback(s store.Store) http.HandlerFunc
Feedback accepts submissions from the in-app widget. Public endpoint — anonymous docs visitors can submit too. Writes to feedback_submissions in Postgres; identity fields (workspace_id, user_id) populate when a session cookie is present, otherwise nil.
Size-cap each free-text field so a noisy caller can't balloon the DB.
func GetScenario ¶
func GetScenario(s store.Store) http.HandlerFunc
func GetWebhook ¶
func GetWebhook(s store.Store) http.HandlerFunc
GetWebhook returns one webhook_log by its id (not by request_log_id).
func GetWebhookStatus ¶
func GetWebhookStatus(s store.Store) http.HandlerFunc
func GetWorkspace ¶
func GetWorkspace(s store.Store) http.HandlerFunc
func Healthz ¶ added in v1.2.0
func Healthz() http.HandlerFunc
Healthz returns a minimal liveness probe suitable for uptime pingers.
Keep this handler side-effect-free: no DB work, no store calls, no logs on the happy path. It runs on every 5-minute uptime ping and we don't want the logs table polluted with thousands of probe entries.
Returns 200 OK with a tiny JSON body so observability tools that parse the response can confirm they spoke to the Go binary (not an upstream proxy or CDN that happens to return 200 on anything).
func ListGateways ¶
func ListGateways(reg *adapters.Registry) http.HandlerFunc
ListGateways returns the set of canonical gateway names known to the server. The dashboard uses this to render per-gateway webhook configuration dynamically so the UI stays in sync with whatever adapters are registered.
func ListScenarios ¶
func ListScenarios(s store.Store) http.HandlerFunc
func ListWebhooks ¶
func ListWebhooks(s store.Store) http.HandlerFunc
ListWebhooks returns all webhook dispatches for the caller's workspace, newest first. Each entry includes target URL, delivery status, attempts, attempt_logs, and the payload sent.
func Logout ¶
func Logout(mode string) http.HandlerFunc
func NewMockWithMode ¶
func ReplayLog ¶
func ReplayLog(s store.Store, eng *engine.Engine, reg *adapters.Registry, d *webhook.Dispatcher) http.HandlerFunc
func RunScenario ¶
func RunScenario(s store.Store, eng *engine.Engine, reg *adapters.Registry, d *webhook.Dispatcher) http.HandlerFunc
func TestWebhook ¶
func TestWebhook(d *webhook.Dispatcher) http.HandlerFunc
func UpdateScenario ¶
func UpdateScenario(s store.Store) http.HandlerFunc
func UpdateWorkspace ¶
func UpdateWorkspace(s store.Store) http.HandlerFunc
UpdateWorkspace lets the authenticated caller edit mutable workspace fields. Currently only WebhookURLs (a gateway → URL map) is editable.
func WorkspaceFromRequest ¶
WorkspaceFromRequest resolves the workspace the current request should act on. Priority:
- Authorization: Bearer <api_key> → lookup by api_key
- Session cookie (Session middleware injects workspace_id into ctx) → by id
- Local fallback: the "local" workspace
Exposed so other handlers can scope queries by caller's workspace.
Types ¶
type MockHandler ¶
type MockHandler struct {
// contains filtered or unexported fields
}
func (*MockHandler) ServeHTTP ¶
func (h *MockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)