July 2019
Intermediate to advanced
502 pages
14h
English
The implementation of the core logic service is in pkg/news_manager. Let's take a look at the new_manager.go file. The NewsManager struct has an InMemoryNewsStore called eventStore that implements the GetNews() method for the NewsManager interface. It delegates the work of actually fetching the news to the store.
However, it is aware of pagination and takes care of converting the token from a string into an integer to match the store preferences:
package news_manager import ( "errors" "github.com/the-gigi/delinkcious/pkg/link_manager_events" om "github.com/the-gigi/delinkcious/pkg/object_model" "strconv" "time" ) type NewsManager struct { eventStore *InMemoryNewsStore } func (m *NewsManager) GetNews(req ...Read now
Unlock full access