status

package
v0.0.0-...-545087f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package status provides a status page handler, for exposing a summary of what the various pieces of the agent are doing.

Inspired heavily by Google "/statsuz" - one public example is at: https://github.com/youtube/doorman/blob/master/go/status/status.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddItem

func AddItem(parent context.Context, title, tmpl string, cb func(context.Context) (any, error)) (context.Context, func())

AddItem adds an item to be displayed on the status page. On each page load, the item's callback is called, and the data returned used to fill the HTML template in tmpl. The title should be unique (among items under this parent).

func AddSimpleItem

func AddSimpleItem(parent context.Context, title string) (ctx context.Context, setStatus func(string), done func())

AddSimpleItem adds a simple status item. Set the value shown by the item by calling setStatus.

func DelItem

func DelItem(parent context.Context, title string)

DelItem removes a status item, specified by the title, from a parent context.

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

Handle handles status page requests.

Types

type ItemCallback

type ItemCallback = func(context.Context) (any, error)

ItemCallback funcs are used by templated status items to provide the value to hydrate the item template.

Jump to

Keyboard shortcuts

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