apprhttp

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: 13 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 apprhttp serves the Approvals queue on the portal (#2437, #2494): a person's own requests, every request for an administrator, filing one and deciding one, through the service manage_approval uses and under its rules. Every write is audited as a manage_approval call from the portal.

Index

Constants

View Source
const Prefix = "/api/v1/portal/approvals"

Prefix opens every route.

Variables

This section is empty.

Functions

func Register

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

Register mounts the routes behind wrap, the portal's authentication.

Types

type Config

type Config struct {
	Service *approval.Service
	// Actor is who made a request, nil for none.
	Actor func(r *http.Request) *approval.Actor
	Audit middleware.AuditLogger
	// Recent reads a call request's requester's recent calls of its
	// operation (#2437); nil answers none.
	Recent func(ctx context.Context, r *approval.Request) ([]RecentCall, error)
}

Config is what the routes use.

type RecentCall added in v1.161.0

type RecentCall struct {
	At      time.Time `json:"at"`
	Items   int       `json:"items" example:"5"`
	Outcome string    `json:"outcome" example:"held"`
}

RecentCall is one of a requester's calls of a held call's operation in the last day: when, how many items, and what came of it, never its arguments.

type RecentCallList added in v1.161.0

type RecentCallList struct {
	Data []RecentCall `json:"data"`
}

RecentCallList is the requester's recent calls, newest first.

Jump to

Keyboard shortcuts

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