MCPcopy Create free account
hub / github.com/docker/docker-agent / dedupKey

Function dedupKey

pkg/hooks/executor.go:302–312  ·  view source on GitHub ↗

dedupKey returns a deterministic key identifying a hook by (type, command, args).

(h Hook)

Source from the content-addressed store, hash-verified

300
301// dedupKey returns a deterministic key identifying a hook by (type, command, args).
302func dedupKey(h Hook) string {
303 var b strings.Builder
304 b.WriteString(h.Type)
305 b.WriteByte(0)
306 b.WriteString(h.Command)
307 for _, a := range h.Args {
308 b.WriteByte(0)
309 b.WriteString(a)
310 }
311 return b.String()
312}
313
314// hookResult is the outcome of a single hook invocation: the raw
315// [HandlerResult] reported by the handler plus a post-execution err

Callers 1

hooksForMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected