v1.11.2 Latest Latest

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 1 Imported by: 48



Package diagnostics provides the diagnostics type so that other packages can provide diagnostics without depending on the monitor package.



This section is empty.


This section is empty.


This section is empty.


type Client

type Client interface {
	Diagnostics() (*Diagnostics, error)

Client is the interface modules implement if they register diagnostics with monitor.

type ClientFunc

type ClientFunc func() (*Diagnostics, error)

The ClientFunc type is an adapter to allow the use of ordinary functions as Diagnostics clients.

func (ClientFunc) Diagnostics

func (f ClientFunc) Diagnostics() (*Diagnostics, error)

Diagnostics calls f().

type Diagnostics

type Diagnostics struct {
	Columns []string
	Rows    [][]interface{}

Diagnostics represents a table of diagnostic information. The first value is the name of the columns, the second is a slice of interface slices containing the values for each column, by row. This information is never written to an InfluxDB system and is display-only. An example showing, say, connections follows:

source_ip    source_port       dest_ip     dest_port    2890       38901   2924       38902

func NewDiagnostics

func NewDiagnostics(columns []string) *Diagnostics

NewDiagnostics initialises a new Diagnostics with the specified columns.

func RowFromMap added in v1.3.0

func RowFromMap(m map[string]interface{}) *Diagnostics

RowFromMap returns a new one-row Diagnostics from a map.

func (*Diagnostics) AddRow

func (d *Diagnostics) AddRow(r []interface{})

AddRow appends the provided row to the Diagnostics' rows.

Jump to

Keyboard shortcuts

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