Documentation
¶
Overview ¶
Package mock provides hand-written mocks of the root service interfaces for testing, in the WTF style: a struct of function fields, each method delegating to its field.
Index ¶
- type FeedService
- func (s *FeedService) FindFeedByURL(ctx context.Context, url string) (*firehose.Feed, error)
- func (s *FeedService) FindFeeds(ctx context.Context, filter firehose.FeedFilter) ([]*firehose.Feed, int, error)
- func (s *FeedService) SyncFeeds(ctx context.Context, feeds []*firehose.Feed) error
- func (s *FeedService) UpdateFeed(ctx context.Context, id int64, upd firehose.FeedUpdate) (*firehose.Feed, error)
- type ItemService
- func (s *ItemService) FindItems(ctx context.Context, filter firehose.ItemFilter) ([]*firehose.Item, int, error)
- func (s *ItemService) ItemStats(ctx context.Context) ([]firehose.ItemStat, error)
- func (s *ItemService) PurgeExpired(ctx context.Context, olderThan time.Time) (int, error)
- func (s *ItemService) UpsertItems(ctx context.Context, items []*firehose.Item) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedService ¶
type FeedService struct {
FindFeedsFn func(ctx context.Context, filter firehose.FeedFilter) ([]*firehose.Feed, int, error)
FindFeedByURLFn func(ctx context.Context, url string) (*firehose.Feed, error)
SyncFeedsFn func(ctx context.Context, feeds []*firehose.Feed) error
UpdateFeedFn func(ctx context.Context, id int64, upd firehose.FeedUpdate) (*firehose.Feed, error)
}
FeedService is a mock firehose.FeedService.
func (*FeedService) FindFeedByURL ¶
func (*FeedService) FindFeeds ¶
func (s *FeedService) FindFeeds(ctx context.Context, filter firehose.FeedFilter) ([]*firehose.Feed, int, error)
func (*FeedService) UpdateFeed ¶
func (s *FeedService) UpdateFeed(ctx context.Context, id int64, upd firehose.FeedUpdate) (*firehose.Feed, error)
type ItemService ¶
type ItemService struct {
FindItemsFn func(ctx context.Context, filter firehose.ItemFilter) ([]*firehose.Item, int, error)
ItemStatsFn func(ctx context.Context) ([]firehose.ItemStat, error)
UpsertItemsFn func(ctx context.Context, items []*firehose.Item) error
PurgeExpiredFn func(ctx context.Context, olderThan time.Time) (int, error)
}
ItemService is a mock firehose.ItemService.
func (*ItemService) FindItems ¶
func (s *ItemService) FindItems(ctx context.Context, filter firehose.ItemFilter) ([]*firehose.Item, int, error)
func (*ItemService) PurgeExpired ¶
func (*ItemService) UpsertItems ¶
Click to show internal directories.
Click to hide internal directories.