AddSubSession creates a sub-session and links it to the parent.
(_ context.Context, parentSessionID string, subSession *Session)
| 314 | |
| 315 | // AddSubSession creates a sub-session and links it to the parent. |
| 316 | func (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. |
| 331 | func (s *InMemorySessionStore) AddSummary(_ context.Context, sessionID, summary string, firstKeptEntry int) error { |
nothing calls this directly
no test coverage detected