X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/5023a5ff75de371f147392be54aec7737fca36a5..4e3341f81d4c9b296c8fd016f4a086752d561efd:/log.go diff --git a/log.go b/log.go index 22012e2..f1727d5 100644 --- a/log.go +++ b/log.go @@ -17,12 +17,12 @@ var errLocked = errors.New("another process owns the chat") // kinds holds the kinds that a message can have. var kinds = map[string]bool{ - "user": true, - "unii": true, - "tool": true, - "echo": true, - "work": true, - "note": true, + "user": true, + "reply": true, + "tool": true, + "echo": true, + "work": true, + "note": true, } // Message is one entry of the chat log. ID is the permanent position of the @@ -38,11 +38,11 @@ type Message struct { // Log is the append-only message log of one chat. It writes one JSON line for // each message to main/YYYY-MM-DD.jsonl, named for the local day of the write. -// It never edits or deletes a line. Each write goes to the file and to the disk -// before Append returns. An exclusive lock on the lock file makes sure that -// only one process writes the log. After a failed write, the end of the file is -// not known, so the log refuses all writes until it is opened again. The caller -// serializes all calls. +// It never edits or deletes a line. Each line goes to the operating system +// before Append returns, so a crash of the process loses no message. An +// exclusive lock on the lock file makes sure that only one process writes the +// log. After a failed write, the end of the file is not known, so the log +// refuses all writes until it is opened again. The caller serializes all calls. type Log struct { clock func() time.Time lock *os.File