mirror of
https://github.com/ChronosX88/yans.git
synced 2024-11-24 20:32:19 +00:00
22 lines
764 B
Go
22 lines
764 B
Go
package backend
|
|
|
|
import "github.com/ChronosX88/yans/internal/models"
|
|
|
|
const (
|
|
SupportedBackendList = "sqlite"
|
|
)
|
|
|
|
type StorageBackend interface {
|
|
ListGroups() ([]models.Group, error)
|
|
ListGroupsByPattern(pattern string) ([]models.Group, error)
|
|
GetGroup(groupName string) (models.Group, error)
|
|
GetNewGroupsSince(timestamp int64) ([]models.Group, error)
|
|
GetArticlesCount(g *models.Group) (int, error)
|
|
GetGroupLowWaterMark(g *models.Group) (int, error)
|
|
GetGroupHighWaterMark(g *models.Group) (int, error)
|
|
SaveArticle(article models.Article, groups []string) error
|
|
GetArticle(messageID string) (models.Article, error)
|
|
GetArticleByNumber(g *models.Group, num int) (models.Article, error)
|
|
GetArticleNumbers(g *models.Group, low, high int64) ([]int64, error)
|
|
}
|