MCPcopy
hub / github.com/docker/compose / filter

Method filter

pkg/compose/containers.go:170–178  ·  view source on GitHub ↗

filter return Containers with elements to match predicate

(predicates ...containerPredicate)

Source from the content-addressed store, hash-verified

168
169// filter return Containers with elements to match predicate
170func (containers Containers) filter(predicates ...containerPredicate) Containers {
171 var filtered Containers
172 for _, c := range containers {
173 if matches(c, predicates...) {
174 filtered = append(filtered, c)
175 }
176 }
177 return filtered
178}
179
180// forEachContainerConcurrent runs fn for every container concurrently and waits for all goroutines.
181func forEachContainerConcurrent(ctx context.Context, containers Containers, fn func(context.Context, container.Summary) error) error {

Callers 15

LogsMethod · 0.95
TopMethod · 0.95
killMethod · 0.95
stopMethod · 0.80
restartMethod · 0.80
RemoveMethod · 0.80
waitDependenciesMethod · 0.80
startServiceMethod · 0.80
PsMethod · 0.80
getContainersMethod · 0.80
downMethod · 0.80

Calls 1

matchesFunction · 0.85

Tested by

no test coverage detected