Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONLLog ¶
type JSONLLog struct{}
JSONLLog keeps one room's log as an append-only JSONL file at ~/.infer/projects/<slug of the room's project>/rooms/<room>.jsonl.
func NewJSONLLog ¶
func NewJSONLLog() *JSONLLog
NewJSONLLog returns the file-backed room log writing under the userspace projects root.
func (*JSONLLog) Append ¶
func (l *JSONLLog) Append(room roomsdomain.Room, post roomsdomain.Post) error
Append adds post to the room's log, stamping a post that carries no time. The log is append-only: the file is always opened for appending, and the rooms dir is created on the way.
func (*JSONLLog) Clear ¶
func (l *JSONLLog) Clear(room roomsdomain.Room) error
Clear removes the room's log, so the room reads as never written. A log that does not exist is already clear.
func (*JSONLLog) Read ¶
func (l *JSONLLog) Read(room roomsdomain.Room) ([]roomsdomain.Post, error)
Read returns the room's posts in the order they were appended, an empty list for a room whose log was never written. A line that does not decode, such as one a crash tore mid-write, is skipped so it costs only itself.