plugin

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPluginsDir

func DefaultPluginsDir() string

Types

type BarChartItem

type BarChartItem struct {
	Label     string   `json:"label"`
	Value     float64  `json:"value"`
	Secondary float64  `json:"secondary,omitempty"`
	Legend    []string `json:"legend,omitempty"`
}

type Executor

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

func NewExecutor

func NewExecutor(plugins []Plugin) *Executor

func (*Executor) Execute

func (e *Executor) Execute(name string) (map[string]json.RawMessage, error)

func (*Executor) Plugins

func (e *Executor) Plugins() []Plugin

type ListItem

type ListItem struct {
	Title    string   `json:"title"`
	Subtitle string   `json:"subtitle,omitempty"`
	Body     string   `json:"body,omitempty"`
	Tags     []string `json:"tags,omitempty"`
}

type MetricItem

type MetricItem struct {
	Label string      `json:"label"`
	Value interface{} `json:"value"`
	Color string      `json:"color"`
}

type Panel

type Panel struct {
	ID          string    `json:"id" yaml:"id"`
	Type        PanelType `json:"type" yaml:"type"`
	Title       string    `json:"title" yaml:"title"`
	Description string    `json:"description,omitempty" yaml:"description,omitempty"`
	Sortable    bool      `json:"sortable,omitempty" yaml:"sortable,omitempty"`
	Expandable  bool      `json:"expandable,omitempty" yaml:"expandable,omitempty"`
	Width       string    `json:"width,omitempty" yaml:"width,omitempty"`
}

type PanelData

type PanelData struct {
	Items   json.RawMessage `json:"items,omitempty"`
	Columns []string        `json:"columns,omitempty"`
	Rows    json.RawMessage `json:"rows,omitempty"`
}

type PanelType

type PanelType string
const (
	PanelMetricRow PanelType = "metric-row"
	PanelTable     PanelType = "table"
	PanelBarChart  PanelType = "bar-chart"
	PanelList      PanelType = "list"
)

type Plugin

type Plugin struct {
	Name       string   `json:"name" yaml:"name"`
	Tab        string   `json:"tab" yaml:"tab"`
	Command    string   `json:"command" yaml:"command"`
	CacheSecs  int      `json:"cache_seconds" yaml:"cache_seconds"`
	Panels     []Panel  `json:"panels" yaml:"panels"`
	AutoDetect []string `json:"-" yaml:"-"`
	BuiltIn    bool     `json:"-" yaml:"-"`
}

func Builtins

func Builtins() []Plugin

func ScanPlugins

func ScanPlugins(dir string) ([]Plugin, error)

type TableData

type TableData struct {
	Columns []string   `json:"columns"`
	Rows    []TableRow `json:"rows"`
}

type TableRow

type TableRow struct {
	Cells []interface{} `json:"cells"`
	Color string        `json:"color,omitempty"`
}

Jump to

Keyboard shortcuts

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