statehttp

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package statehttp serves a managed script's state on its portal page (#1537): reading the one JSON object a script carries from run to run, and the owner's two resets of it.

It is mounted by scripthttp, which resolves the caller and the script and refuses everybody but the script's owner and an administrator before any handler here runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	States script.StateStore
	// Owned resolves the script in the path for a caller who owns it, or
	// writes the refusal and reports false. actor is who the caller is, as a
	// reset records it.
	Owned func(w http.ResponseWriter, r *http.Request) (scriptID, actor string, ok bool)
}

Deps carries the state store and the ownership gate.

type Handler

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

Handler serves the state routes.

func New

func New(deps Deps) *Handler

New builds the handler.

func (*Handler) Register

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

Register mounts the state routes, each wrapped in the portal authentication middleware.

Jump to

Keyboard shortcuts

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