Last change
on this file since 439 was 439, checked in by contact, 4 years ago |
Turn messageStore into an interface
This allows for other implementations that aren't based on a filesystem.
|
File size:
773 bytes
|
Rev | Line | |
---|
[423] | 1 | package soju
|
---|
| 2 |
|
---|
| 3 | import (
|
---|
| 4 | "time"
|
---|
| 5 |
|
---|
| 6 | "gopkg.in/irc.v3"
|
---|
| 7 | )
|
---|
| 8 |
|
---|
| 9 | // messageStore is a per-user store for IRC messages.
|
---|
[439] | 10 | type messageStore interface {
|
---|
| 11 | Close() error
|
---|
| 12 | // LastMsgID queries the last message ID for the given network, entity and
|
---|
| 13 | // date. The message ID returned may not refer to a valid message, but can be
|
---|
| 14 | // used in history queries.
|
---|
| 15 | LastMsgID(network *network, entity string, t time.Time) (string, error)
|
---|
| 16 | LoadBeforeTime(network *network, entity string, t time.Time, limit int) ([]*irc.Message, error)
|
---|
| 17 | LoadAfterTime(network *network, entity string, t time.Time, limit int) ([]*irc.Message, error)
|
---|
| 18 | LoadLatestID(network *network, entity, id string, limit int) ([]*irc.Message, error)
|
---|
| 19 | Append(network *network, entity string, msg *irc.Message) (id string, err error)
|
---|
[423] | 20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.