outputshttp

package
v1.170.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package outputshttp serves the outputs of the script runs a caller asked for (#1848): an application that runs scripts for its users reads back what those runs wrote, across scripts, filtered by script, tag and metadata, each with a short-lived link that downloads it.

It is mounted by scripthttp, which resolves the caller. A caller reads the outputs of the runs it requested, whoever owns the scripts, because the run already handed them to it; an administrator reads every run's.

Index

Constants

View Source
const Route = "GET /api/v1/portal/scripts/runs/outputs"

Route is where the listing is served. A literal segment outranks the {id} wildcard, so no script id can shadow it.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Runs RunLister
	// Caller is who is asking, or ok=false after writing the refusal. An
	// administrator reads every run's outputs.
	Caller func(w http.ResponseWriter, r *http.Request) (requester string, isAdmin, ok bool)
	// ContentURL mints a signed link to one asset version, and its expiry.
	// Nil leaves outputs without a link.
	ContentURL func(assetID string, version int) (string, time.Time)
}

Deps carries the run history, the caller, and the link minter.

type Handler

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

Handler serves the listing.

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 route, wrapped in the portal authentication middleware.

type RunLister

type RunLister interface {
	ListRuns(ctx context.Context, filter script.RunFilter) ([]script.Run, error)
}

RunLister reads run history.

Jump to

Keyboard shortcuts

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