grafana

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Name  string     `json:"name"`
	State AlertState `json:"state"`
	URL   string     `json:"url"`
}

type AlertState

type AlertState int
const (
	Alerting AlertState = iota
	Pending
	NoData
	Paused
	Ok
)

func (AlertState) MarshalJSON

func (s AlertState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (*AlertState) UnmarshalJSON

func (s *AlertState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(settings *Settings) *Client

func (*Client) Alerts

func (client *Client) Alerts() ([]Alert, error)

type Settings

type Settings struct {
	*cfg.Common
	// contains filtered or unexported fields
}

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

type Widget

type Widget struct {
	view.TextWidget

	Client   *Client
	Alerts   []Alert
	Err      error
	Selected int
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(tviewApp *tview.Application, redrawChan chan bool, _ *tview.Pages, settings *Settings) *Widget

func (*Widget) GetSelected

func (widget *Widget) GetSelected() int

GetSelected returns the index of the currently highlighted item as an int

func (*Widget) Next

func (widget *Widget) Next()

Next cycles the currently highlighted text down

func (*Widget) Prev

func (widget *Widget) Prev()

Prev cycles the currently highlighted text up

func (*Widget) Refresh

func (widget *Widget) Refresh()

func (*Widget) Unselect

func (widget *Widget) Unselect()

Unselect stops highlighting the text and jumps the scroll position to the top

Jump to

Keyboard shortcuts

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