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