utils

package
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compact

func Compact[V comparable](args ...V) []V

func CompactFunc added in v0.0.48

func CompactFunc[V any](isempty func(v V) bool, args ...V) []V

func ExtendTimeout

func ExtendTimeout(ctx context.Context, extra_time time.Duration)

func IntersectHoles

func IntersectHoles[V comparable](list *[]V, list2 []V)

func IntersectHolesFunc added in v0.0.48

func IntersectHolesFunc[V any](list *[]V, list2 []V, eql func(v1, v2 V) bool)

func NewSystemdClient added in v0.0.45

func NewSystemdClient(ctx context.Context) (*dbus.Conn, error)

func SetCloseOnExec added in v0.0.45

func SetCloseOnExec(fd int, close bool) (err error)

func SortedStringKeys added in v0.0.15

func SortedStringKeys[Value any](m map[string]Value) []string

func UnitsStatus added in v0.0.45

func UnitsStatus(ctx context.Context, sd *dbus.Conn, specs UnitStatusSpecs) ([]dbus.UnitStatus, error)

Types

type JSONDuration added in v0.0.49

type JSONDuration time.Duration

func (JSONDuration) MarshalJSON added in v0.0.49

func (d JSONDuration) MarshalJSON() ([]byte, error)

func (*JSONDuration) UnmarshalJSON added in v0.0.49

func (d *JSONDuration) UnmarshalJSON(b []byte) error

type Tabbed added in v0.0.15

type Tabbed struct {
	Rows [][]string
}

func (*Tabbed) AddRow added in v0.0.15

func (t *Tabbed) AddRow(cells ...string) *Tabbed

func (*Tabbed) Lines added in v0.0.15

func (t *Tabbed) Lines() []string

func (*Tabbed) String added in v0.0.15

func (t *Tabbed) String() string

func (*Tabbed) Tabulate added in v0.0.15

func (t *Tabbed) Tabulate() *Tabbed

type UnitStatusSpec added in v0.0.45

type UnitStatusSpec struct {
	Name    string
	Pattern string

	Units []dbus.UnitStatus
	// contains filtered or unexported fields
}

type UnitStatusSpecs added in v0.0.45

type UnitStatusSpecs []*UnitStatusSpec

func (UnitStatusSpecs) ToTable added in v0.0.45

func (specs UnitStatusSpecs) ToTable() table.Table

Jump to

Keyboard shortcuts

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