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 ¶
- func AddItem(parent context.Context, title, tmpl string, ...) (context.Context, func())
- func AddSimpleItem(parent context.Context, title string) (ctx context.Context, setStatus func(string), done func())
- func DelItem(parent context.Context, title string)
- func Handle(w http.ResponseWriter, r *http.Request)
- type ItemCallback
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.
Types ¶
Click to show internal directories.
Click to hide internal directories.