MCPcopy Index your code
hub / github.com/docker/docker-agent / AddSubSession

Method AddSubSession

pkg/session/store.go:316–328  ·  view source on GitHub ↗

AddSubSession creates a sub-session and links it to the parent.

(_ context.Context, parentSessionID string, subSession *Session)

Source from the content-addressed store, hash-verified

314
315// AddSubSession creates a sub-session and links it to the parent.
316func (s *InMemorySessionStore) AddSubSession(_ context.Context, parentSessionID string, subSession *Session) error {
317 if parentSessionID == "" {
318 return ErrEmptyID
319 }
320 parent, exists := s.sessions.Load(parentSessionID)
321 if !exists {
322 return ErrNotFound
323 }
324 subSession.ParentID = parentSessionID
325 s.sessions.Store(subSession.ID, subSession)
326 parent.AddSubSession(subSession)
327 return nil
328}
329
330// AddSummary adds a summary item to a session at the next position.
331func (s *InMemorySessionStore) AddSummary(_ context.Context, sessionID, summary string, firstKeptEntry int) error {

Callers

nothing calls this directly

Calls 3

LoadMethod · 0.80
AddSubSessionMethod · 0.65
StoreMethod · 0.45

Tested by

no test coverage detected