Simple RSS/Atom feed source for diretto
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

package filebackend
import (
"errors"
"os"
"github.com/gorilla/feeds"
)
// FileBackend is a file-based storage backend for bacheca
type FileBackend struct {
path string
}
// MakeFileBackend returns a FileBackend instance
func MakeFileBackend(path string) (*FileBackend, error) {
stat, err := os.Stat(path)
if err == nil && stat.IsDir() {
return nil, errors.New("file backend must be a file")
}
return &FileBackend{
path: path,
}, err
}
// GetFeed returns the whole feed
func (b *FileBackend) GetFeed() (*feeds.Feed, error) {
return nil, errors.New("not implemented")
}
// AddItem adds an item to the feed
func (b *FileBackend) AddItem(item feeds.Item) (string, error) {
return "", errors.New("not implemented")
}
// RemoveItem removes an item by ID
func (b *FileBackend) RemoveItem(id string) error {
return errors.New("not implemented")
}
// ReplaceItem replaces the item at a specified ID with the data provided
func (b *FileBackend) ReplaceItem(id string, item feeds.Item) error {
return errors.New("not implemented")
}
// SetInfo sets the feed metadata (like title and description)
func (b *FileBackend) SetInfo(info feeds.Feed) error {
return errors.New("not implemented")
}