web

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 17 Imported by: 1 module, 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 web is grpcprocctl's web UI: a page in the browser that shows a grpcproc cluster through its Inspector, live, as Erlang's observer shows a BEAM node. It serves the page and the API behind it from one handler; the API returns the objects grpcprocctl --json prints and its MCP tools return, and streams a node's events as server-sent events.

grpcprocctl --plaintext web              # http://localhost:9911
grpcprocctl --plaintext web --allow-writes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *client.Client, o Options) http.Handler

New returns the page and its API over c.

Types

type CronRequest

type CronRequest struct {
	Node   string `json:"node"`
	Target string `json:"target"`
	Op     string `json:"op"`
	Job    string `json:"job"`
}

CronRequest changes a job of a cron process: Op is enable, disable or remove.

type ExitRequest

type ExitRequest struct {
	Node   string `json:"node"`
	Target string `json:"target"`
	Reason string `json:"reason"`
}

ExitRequest asks a process to exit.

type Info

type Info struct {
	Version     string `json:"version"`
	Target      string `json:"target"`
	AllowWrites bool   `json:"allow_writes"`
}

Info is what the page shows about the tool itself.

type LeaderRequest

type LeaderRequest struct {
	Cluster string `json:"cluster"`
	Op      string `json:"op"`
	Node    string `json:"node"`
	To      string `json:"to"`
}

LeaderRequest changes an election through its leader: Op move hands leadership To a node (by default the follower with the latest state); cordon and uncordon keep Node from leading, or let it again.

type LeaderResponse

type LeaderResponse struct {
	Led string `json:"led"`
}

LeaderResponse names the node that led when the change was made.

type LogLevelRequest

type LogLevelRequest struct {
	Node   string `json:"node"`
	Target string `json:"target"`
	Level  string `json:"level"`
}

LogLevelRequest sets a process's log level.

type Nodes added in v0.12.0

type Nodes struct {
	Nodes   []client.NodeView `json:"nodes"`
	TakenAt int64             `json:"taken_at"` // when the walk ended, in Unix milliseconds
}

Nodes is what /api/nodes answers.

type Options

type Options struct {
	// AllowWrites also serves the requests that change things: exit a
	// process, set its log level, move or cordon a leader, change a cron
	// job, resume a stuck saga run. Without it they are refused, and the page does not offer them.
	AllowWrites bool
	// Version and Target (the Inspector's address) are shown in the page.
	Version, Target string
	// Timeout bounds each Inspector request. Default 5s.
	Timeout time.Duration
	// LoopbackOnly refuses a request whose Host is not localhost or a
	// loopback address. On a loopback listener it keeps a page on another
	// site, whose name that site has pointed at 127.0.0.1 (DNS rebinding),
	// from reading the cluster through the browser.
	LoopbackOnly bool
}

Options configures New.

type SagaRequest added in v0.11.0

type SagaRequest struct {
	Node string `json:"node"`
	Saga string `json:"saga"`
	ID   string `json:"id"`
}

SagaRequest names a run of a saga, on Node's engine or, when Node is empty, on an engine that runs the saga.

type SagaRuns added in v0.11.0

type SagaRuns struct {
	Runs []client.SagaRunView `json:"runs"`
	More bool                 `json:"more"`
}

SagaRuns is a page of a saga's runs, and whether more follow its last.

Jump to

Keyboard shortcuts

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