textlog

package
v1.5.1-0...-475df33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package textlog implements write-only human-readable per-channel log files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage mirrors text.ts's TextFileMessageStorage: write-only, per-channel human-readable log files. It never serves history back (GetMessages always returns empty - "they do not contain enough data to fully re-create message objects", per the original comment) and cannot search.

func New

func New(username, logsPath string) *Storage

New mirrors `new TextFileMessageStorage(username)`. logsPath is the user logs directory (Config.getUserLogsPath()).

func (*Storage) CanProvideMessages

func (s *Storage) CanProvideMessages() bool

CanProvideMessages mirrors text.ts's canProvideMessages().

func (*Storage) Close

func (s *Storage) Close()

Close mirrors text.ts's close().

func (*Storage) DeleteChannel

func (s *Storage) DeleteChannel(network *model.Network, channel *model.Chan)

DeleteChannel mirrors text.ts's deleteChannel() - not implemented for text log files.

func (*Storage) Enable

func (s *Storage) Enable() error

Enable mirrors text.ts's enable() - just flips the flag; directories are created lazily per-channel in Index.

func (*Storage) GetMessages

func (s *Storage) GetMessages(network *model.Network, channel *model.Chan, nextID func() int, limit int, before *store.MessageCursor) store.MessagePage

GetMessages mirrors text.ts's getMessages() - text logs don't contain enough structured data to reconstruct Msg values, so this always returns empty; use sqlite storage instead.

func (*Storage) Index

func (s *Storage) Index(network *model.Network, channel *model.Chan, msg *model.Msg)

Index mirrors text.ts's index().

func (*Storage) IsEnabled

func (s *Storage) IsEnabled() bool

IsEnabled reports the isEnabled field.

func (*Storage) Update

func (s *Storage) Update(network *model.Network, channel *model.Chan, msg *model.Msg)

Update is a no-op because text logs cannot reconstruct structured messages on reload and therefore cannot persist reaction metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL