Skip to content

Commit

Permalink
feat: standardizing the creation of backends
Browse files Browse the repository at this point in the history
  • Loading branch information
TypicalAM committed Dec 30, 2022
1 parent 5b517e7 commit af5fb9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/backend/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
// Create a fake backed for testing
type FakeBackend struct{}

// Create a new fake backend
func New() FakeBackend {
return FakeBackend{}
}

// Name returns the name of the backend
func (b FakeBackend) Name() string {
return "FakeBackend"
Expand Down
1 change: 1 addition & 0 deletions internal/rss/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var errNotFound = errors.New("Resource not found")

func New() Rss {
rss := Rss{}
// TODO: passing in and reading from a config file
rss["news"] = make(Category)
rss["news"]["cnn"] = "http://rss.cnn.com/rss/cnn_topstories.rss"
rss["news"]["reddit"] = "http://www.reddit.com/r/news/.rss"
Expand Down

0 comments on commit af5fb9a

Please sign in to comment.