status

package module
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

Package status displays information about the agent.

Index

Constants

View Source
const CollectorSection string = "collector"

CollectorSection stores the collector section name

Variables

This section is empty.

Functions

func HTMLFmap

func HTMLFmap() htemplate.FuncMap

HTMLFmap return a map of utility functions for HTML templating

func PrintDashes

func PrintDashes(s string, dash string) string

PrintDashes repeats the pattern (dash) for the length of s

func RenderHTML

func RenderHTML(templateFS embed.FS, template string, buffer io.Writer, data any) error

RenderHTML reads, parse and execute template from embed.FS

func RenderText

func RenderText(templateFS embed.FS, template string, buffer io.Writer, data any) error

RenderText reads, parse and execute template from embed.FS

func TextFmap

func TextFmap() ttemplate.FuncMap

TextFmap map of utility functions for text templating

Types

type Component

type Component interface {
	// Returns all the agent status information for the format type
	GetStatus(format string, verbose bool, excludeSection ...string) ([]byte, error)
	// Returns only the agent status for the especify section and format type
	GetStatusBySection(section string, format string, verbose bool) ([]byte, error)
}

Component interface to access the agent status.

type HeaderInformationProvider

type HeaderInformationProvider struct {
	fx.Out

	Provider HeaderProvider `group:"header_status"`
}

HeaderInformationProvider stores the HeaderProvider instance

func NewHeaderInformationProvider

func NewHeaderInformationProvider(provider HeaderProvider) HeaderInformationProvider

NewHeaderInformationProvider returns a new HeaderInformationProvider to be called when generating the agent status

type HeaderProvider

type HeaderProvider interface {
	// Index is used to choose the order in which the header information is displayed.
	Index() int
	// When displaying the Text output the name is render as a header
	Name() string
	JSON(verbose bool, stats map[string]interface{}) error
	Text(verbose bool, buffer io.Writer) error
	HTML(verbose bool, buffer io.Writer) error
}

HeaderProvider interface

type InformationProvider

type InformationProvider struct {
	fx.Out

	Provider Provider `group:"status"`
}

InformationProvider stores the Provider instance

func NewInformationProvider

func NewInformationProvider(provider Provider) InformationProvider

NewInformationProvider returns a InformationProvider to be called when generating the agent status

type Params

type Params struct {
	PythonVersionGetFunc func() string
}

Params store configurable options for the status component

type Provider

type Provider interface {
	// Name is used to sort the status providers alphabetically.
	Name() string
	// Section is used to group the status providers.
	// When displaying the Text output the section is render as a header
	Section() string
	JSON(verbose bool, stats map[string]interface{}) error
	Text(verbose bool, buffer io.Writer) error
	HTML(verbose bool, buffer io.Writer) error
}

Provider interface

Directories

Path Synopsis
statusimpl module

Jump to

Keyboard shortcuts

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