Documentation
¶
Overview ¶
Package textlog implements write-only human-readable per-channel log files.
Index ¶
- type Storage
- func (s *Storage) CanProvideMessages() bool
- func (s *Storage) Close()
- func (s *Storage) DeleteChannel(network *model.Network, channel *model.Chan)
- func (s *Storage) Enable() error
- func (s *Storage) GetMessages(network *model.Network, channel *model.Chan, nextID func() int, limit int, ...) store.MessagePage
- func (s *Storage) Index(network *model.Network, channel *model.Chan, msg *model.Msg)
- func (s *Storage) IsEnabled() bool
- func (s *Storage) Update(network *model.Network, channel *model.Chan, msg *model.Msg)
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 ¶
New mirrors `new TextFileMessageStorage(username)`. logsPath is the user logs directory (Config.getUserLogsPath()).
func (*Storage) CanProvideMessages ¶
CanProvideMessages mirrors text.ts's canProvideMessages().
func (*Storage) DeleteChannel ¶
DeleteChannel mirrors text.ts's deleteChannel() - not implemented for text log files.
func (*Storage) Enable ¶
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.