cgroupsprinter

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MPL-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package cgroupsprinter provides functions to print cgroup information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPresetNames

func GetPresetNames() []string

GetPresetNames returns the list of preset names.

func PrintNode

func PrintNode(name string, w io.Writer, schema *Schema, node, parent *cgroups.Node, level int, levelsEnded []int, lastNode, treeRoot bool) error

PrintNode prints the cgroup node recursively.

Types

type Column

type Column struct {
	Name string `yaml:"name"`

	Template string `yaml:"template"` // Template is a Go template string.
	// contains filtered or unexported fields
}

Column defines a column for cgroups printer.

func (*Column) Render

func (c *Column) Render(out io.Writer, data any) error

Render the template with the data.

type Schema

type Schema struct {
	Columns []*Column `yaml:"columns"`
}

Schema defines columns for cgroups printer.

func GetPreset

func GetPreset(name string) Schema

GetPreset returns the preset by name.

func (*Schema) Compile

func (s *Schema) Compile() error

Compile compiles the templates.

func (*Schema) HeaderLine

func (s *Schema) HeaderLine() string

HeaderLine returns the header line.

func (*Schema) Render

func (s *Schema) Render(data any) (string, error)

Render returns the row line.

Jump to

Keyboard shortcuts

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