Documentation ¶
Overview ¶
Package source is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HNClient ¶
type HNClient interface { GetTopStories(int) ([]int, error) GetItem(id int) (hnclient.Item, error) }
HNClient has the functions used from the munrocape/hn library that we use. It's wrapped in an interface like this so that we can mock and test it.
type HackerNews ¶
type HackerNews struct {
// contains filtered or unexported fields
}
HackerNews is our used Hacker News client
func NewHN ¶
func NewHN(client HNClient) *HackerNews
NewHN will create a new HackerNews client to use as a source
func (*HackerNews) FeedItems ¶
func (h *HackerNews) FeedItems(count int) []FeedItem
FeedItems will grab as many stop stories as specified
type MockHNClient ¶
type MockHNClient struct {
// contains filtered or unexported fields
}
MockHNClient is a mock of HNClient interface
func NewMockHNClient ¶
func NewMockHNClient(ctrl *gomock.Controller) *MockHNClient
NewMockHNClient creates a new mock instance
func (*MockHNClient) EXPECT ¶
func (m *MockHNClient) EXPECT() *MockHNClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHNClient) GetItem ¶
func (m *MockHNClient) GetItem(arg0 int) (hnclient.Item, error)
GetItem mocks base method
func (*MockHNClient) GetTopStories ¶
func (m *MockHNClient) GetTopStories(arg0 int) ([]int, error)
GetTopStories mocks base method
type MockHNClientMockRecorder ¶
type MockHNClientMockRecorder struct {
// contains filtered or unexported fields
}
MockHNClientMockRecorder is the mock recorder for MockHNClient
func (*MockHNClientMockRecorder) GetItem ¶
func (mr *MockHNClientMockRecorder) GetItem(arg0 interface{}) *gomock.Call
GetItem indicates an expected call of GetItem
func (*MockHNClientMockRecorder) GetTopStories ¶
func (mr *MockHNClientMockRecorder) GetTopStories(arg0 interface{}) *gomock.Call
GetTopStories indicates an expected call of GetTopStories