bacheca/storage/storage.go

24 lines
673 B
Go

package storage
import "github.com/gorilla/feeds"
// Backend is a storage backend for bacheca
type Backend interface {
// GetFeed returns the whole feed
GetFeed() (*feeds.Feed, error)
// AddItem adds an item to the feed
// If an ID is not specified, one will be generated randomly
// The return value is the ID, generated or provided
AddItem(item feeds.Item) (string, error)
// RemoveItem removes an item by ID
RemoveItem(id string) error
// ReplaceItem replaces the item at a specified ID with the data provided
ReplaceItem(id string, item feeds.Item) error
// SetInfo sets the feed metadata (like title and description)
SetInfo(info feeds.Feed) error
}