Documentation
¶
Overview ¶
Package status displays information about the agent.
Index ¶
- Constants
- func HTMLFmap() pkghtmltemplate.FuncMap
- func PrintDashes(s string, dash string) string
- func RenderHTML(templateFS embed.FS, template string, buffer io.Writer, data any) error
- func RenderText(templateFS embed.FS, template string, buffer io.Writer, data any) error
- func TextFmap() pkgtexttemplate.FuncMap
- type Component
- type HeaderInformationProvider
- type HeaderProvider
- type InformationProvider
- type Params
- type Provider
Constants ¶
const CollectorSection string = "collector"
CollectorSection stores the collector section name
Variables ¶
This section is empty.
Functions ¶
func HTMLFmap ¶
func HTMLFmap() pkghtmltemplate.FuncMap
HTMLFmap return a map of utility functions for HTML templating
func PrintDashes ¶
PrintDashes repeats the pattern (dash) for the length of s
func RenderHTML ¶
RenderHTML reads, parse and execute template from embed.FS
func RenderText ¶
RenderText reads, parse and execute template from embed.FS
func TextFmap ¶
func TextFmap() pkgtexttemplate.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)
//
GetSections() []string
// Returns only the agent status for the specified sections and format type
GetStatusBySections(sections []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 ¶
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