Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchUnitPatterns ¶
func MatchUnitPatterns(patterns []string, units []dbus.UnitStatus) ([]dbus.UnitStatus, error)
MatchUnitPatterns returns a list of units that match the pattern list. This algo, including filepath.Match, is designed to (somewhat) emulate the behavior of ListUnitsByPatterns, which uses `fnmatch`.
Types ¶
type UnitFetcher ¶
type UnitFetcher func(ctx context.Context, conn *dbus.Conn, states, patterns []string) ([]dbus.UnitStatus, error)
UnitFetcher a unit retrieval method
func InstrospectForUnitMethods ¶
func InstrospectForUnitMethods(conn *dbusRaw.Conn) (UnitFetcher, error)
InstrospectForUnitMethods determines what methods are available via dbus for listing systemd units. We have a number of functions, some better than others, for getting and filtering unit lists. This will attempt to find the most optimal method, and move down to methods that require more work.
Click to show internal directories.
Click to hide internal directories.