cgrp

package
v0.42.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CgroupFlagName = "cgroup"
)

Names of the CLI flags defined and used in this package.

Variables

View Source
var ControlGroupNameModes = map[ControlGroupNames][]string{
	CgroupShortened: {"short"},
	CgroupComplete:  {"full", "complete"},
}

ControlGroupNameModes specifies the mapping between the user-facing CLI flag values and the program-internal flag values.

Functions

func CgroupDisplayName

func CgroupDisplayName(cmd *cobra.Command) func(string) string

CgroupDisplayName returns a function configured based on CLI flags, where the returned function takes a control group name (path) and returns a name better suited for display. In particular, it optionally shortens 64 hex digit IDs as used by Docker for identifying containers to the Docker-typical 12 hex digit "digest".

func SetupCLI

func SetupCLI(cmd *cobra.Command)

SetupCLI adds the flags for controlling control group name display.

Types

type ControlGroupNames

type ControlGroupNames enumflag.Flag

ControlGroupNames defines the enumeration flag type for controlling optimizing control group names for display (or not).

const (
	// CgroupShortened enables optimizing the display of Docker container IDs.
	CgroupShortened ControlGroupNames = iota
	// CgroupComplete switches off any display optimization of control group
	// names.
	CgroupComplete
)

Jump to

Keyboard shortcuts

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