source

package
v0.0.0-...-05604f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 3 Imported by: 0

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 FeedItem

type FeedItem struct {
	Description string
	URL         string
}

FeedItem represents a single item to show on my reading feed

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL