MCPcopy
hub / github.com/docker/docker-agent / Tools

Method Tools

pkg/tools/startable.go:196–208  ·  view source on GitHub ↗

Tools lists the underlying toolset's tools and tracks listing-failure streaks so callers can de-duplicate warnings via ShouldReportListFailure(). A successful listing clears the streak so a future failure is reported as fresh.

(ctx context.Context)

Source from the content-addressed store, hash-verified

194// A successful listing clears the streak so a future failure is reported as
195// fresh.
196func (s *StartableToolSet) Tools(ctx context.Context) ([]Tool, error) {
197 ta, err := s.ToolSet.Tools(ctx)
198
199 s.mu.Lock()
200 defer s.mu.Unlock()
201 if err != nil {
202 s.listStreak.fail()
203 return nil, err
204 }
205
206 s.listStreak.reset()
207 return ta, nil
208}
209
210// Stop stops the toolset if it implements Startable and resets
211// the started flag so that a subsequent Start will re-initialize.

Callers

nothing calls this directly

Calls 5

ToolsMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
failMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected