SingleSubsystem returns a single cgroup subsystem within the base Hierarchy
(baseHierarchy Hierarchy, subsystem Name)
| 100 | |
| 101 | // SingleSubsystem returns a single cgroup subsystem within the base Hierarchy |
| 102 | func SingleSubsystem(baseHierarchy Hierarchy, subsystem Name) Hierarchy { |
| 103 | return func() ([]Subsystem, error) { |
| 104 | subsystems, err := baseHierarchy() |
| 105 | if err != nil { |
| 106 | return nil, err |
| 107 | } |
| 108 | for _, s := range subsystems { |
| 109 | if s.Name() == subsystem { |
| 110 | return []Subsystem{ |
| 111 | s, |
| 112 | }, nil |
| 113 | } |
| 114 | } |
| 115 | return nil, fmt.Errorf("unable to find subsystem %s", subsystem) |
| 116 | } |
| 117 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…