2020-04-03 16:59:17 +00:00
|
|
|
package soju
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"gopkg.in/irc.v3"
|
|
|
|
)
|
|
|
|
|
2020-10-25 10:13:51 +00:00
|
|
|
// messageStore is a per-user store for IRC messages.
|
2021-01-04 13:24:00 +00:00
|
|
|
type messageStore interface {
|
|
|
|
Close() error
|
|
|
|
// LastMsgID queries the last message ID for the given network, entity and
|
|
|
|
// date. The message ID returned may not refer to a valid message, but can be
|
|
|
|
// used in history queries.
|
|
|
|
LastMsgID(network *network, entity string, t time.Time) (string, error)
|
|
|
|
LoadBeforeTime(network *network, entity string, t time.Time, limit int) ([]*irc.Message, error)
|
|
|
|
LoadAfterTime(network *network, entity string, t time.Time, limit int) ([]*irc.Message, error)
|
|
|
|
LoadLatestID(network *network, entity, id string, limit int) ([]*irc.Message, error)
|
|
|
|
Append(network *network, entity string, msg *irc.Message) (id string, err error)
|
2020-08-19 11:17:32 +00:00
|
|
|
}
|