Save appends an entry to the in-progress session draft. Nothing reaches disk until Close — drafts are cheap, and per-Save file writes during a busy session would be needless churn.
(_ context.Context, e Entry)
| 98 | // disk until Close — drafts are cheap, and per-Save file writes during a |
| 99 | // busy session would be needless churn. |
| 100 | func (s *SessionFiles) Save(_ context.Context, e Entry) error { |
| 101 | if e.Time.IsZero() { |
| 102 | e.Time = time.Now() |
| 103 | } |
| 104 | s.mu.Lock() |
| 105 | s.draft = append(s.draft, e) |
| 106 | s.mu.Unlock() |
| 107 | return nil |
| 108 | } |
| 109 | |
| 110 | // Recall walks the index and returns up to `limit` session records whose |
| 111 | // summary or tags match the query. Match is a case-insensitive substring |
no outgoing calls