2021-11-02 19:08:21 +01:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
_ "github.com/mattn/go-sqlite3" // SQLite driver
|
2021-11-03 02:09:49 +01:00
|
|
|
"time"
|
2021-11-02 19:08:21 +01:00
|
|
|
)
|
|
|
|
|
2021-11-03 02:09:49 +01:00
|
|
|
type cache interface {
|
|
|
|
AddMessage(m *message) error
|
2021-11-08 15:46:31 +01:00
|
|
|
Messages(topic string, since sinceTime) ([]*message, error)
|
2021-11-03 02:09:49 +01:00
|
|
|
MessageCount(topic string) (int, error)
|
|
|
|
Topics() (map[string]*topic, error)
|
|
|
|
Prune(keep time.Duration) error
|
2021-11-02 19:08:21 +01:00
|
|
|
}
|