cgroupsprinter

package
v1.13.13 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MPL-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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