Skip to main content

Crate yk_session

Crate yk_session 

Source
Expand description

Append-only JSONL sessions, stored as a tree of entries.

Every entry carries an id and a parent id. The active branch is the parent chain walked back from the last entry, so nothing is ever rewritten and a compaction is an entry that shadows what came before it.

Structs§

Header
The first line of a session file.
Session
An open session and the history it is backed by.
SessionFile
One session file, and when it was last written.
SessionLog
A session file opened for appending.

Enums§

Entry
One line of a session file.

Constants§

CURRENT_VERSION
The version of the session file format this build writes.

Functions§

default_dir
Default location for session files.
entry_to_message
The message an entry contributes to the conversation, if any.
list_sessions
The sessions in dir, newest first.
new_session_name
A name no other session has: the second it was made, and the process id.
path_for
The path for a named session.
session_name_of
The name of a session file, without the directory or the extension.
summary_message
The message a compaction contributes to the conversation.