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

Function WithAttachedFiles

pkg/session/session.go:936–942  ·  view source on GitHub ↗

WithAttachedFiles seeds the session with absolute paths of files the user attached. Used when creating sub-sessions so that delegated agents inherit the parent's file context. Empty and duplicate paths are dropped.

(paths []string)

Source from the content-addressed store, hash-verified

934// attached. Used when creating sub-sessions so that delegated agents inherit
935// the parent's file context. Empty and duplicate paths are dropped.
936func WithAttachedFiles(paths []string) Opt {
937 return func(s *Session) {
938 for _, p := range paths {
939 s.AddAttachedFile(p)
940 }
941 }
942}
943
944// IsSubSession returns true if this session is a sub-session (has a parent).
945func (s *Session) IsSubSession() bool {

Callers 2

newSubSessionFunction · 0.92
TestWithAttachedFilesFunction · 0.85

Calls 1

AddAttachedFileMethod · 0.80

Tested by 1

TestWithAttachedFilesFunction · 0.68