Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Index ¶
- func NewMockClient() prowlredis.ClientInterface
- type CrawlManagerInterface
- func (_m *CrawlManagerInterface) Collector(_a0 *colly.Collector) *crawler.CollectorWrapper
- func (_m *CrawlManagerInterface) Crawl(ctx context.Context, url string, searchTerms string, crawlSiteID string, ...) ([]crawler.PageData, error)
- func (_m *CrawlManagerInterface) CrawlURL(url string) error
- func (_m *CrawlManagerInterface) HandleVisitError(url string, err error) error
- func (_m *CrawlManagerInterface) Logger() logger.Logger
- func (_m *CrawlManagerInterface) ProcessMatchingLink(options *crawler.CrawlOptions, currentURL string, pageData crawler.PageData, ...)
- func (_m *CrawlManagerInterface) SetupCrawlingLogic(_a0 *crawler.CrawlOptions) error
- func (_m *CrawlManagerInterface) SetupErrorEventHandler(collector *colly.Collector)
- func (_m *CrawlManagerInterface) SetupHTMLParsingHandler(handler func(*colly.HTMLElement)) error
- func (_m *CrawlManagerInterface) UpdateStats(options *crawler.CrawlOptions, matchingTerms []string)
- type MockClient
- func (m *MockClient) Del(_ context.Context, keys ...string) error
- func (m *MockClient) Options() *prowlredis.Options
- func (m *MockClient) Ping(_ context.Context) error
- func (m *MockClient) SAdd(_ context.Context, key string, members ...interface{}) error
- func (m *MockClient) SIsMember(_ context.Context, key string, member interface{}) (bool, error)
- func (m *MockClient) SMembers(_ context.Context, key string) ([]string, error)
- type MockCollectorInterface
- func (m *MockCollectorInterface) AllowURLRevisit() bool
- func (m *MockCollectorInterface) EXPECT() *MockCollectorInterfaceMockRecorder
- func (m *MockCollectorInterface) GetUnderlyingCollector() *colly.Collector
- func (m *MockCollectorInterface) IgnoreRobotsTxt() bool
- func (m *MockCollectorInterface) Limit(limitRule colly.LimitRule) error
- func (m *MockCollectorInterface) OnError(arg0 func(*colly.Response, error))
- func (m *MockCollectorInterface) OnHTML(selector string, cb func(*colly.HTMLElement))
- func (m *MockCollectorInterface) OnScraped(callback func(*colly.Response))
- func (m *MockCollectorInterface) SetAllowURLRevisit(allow bool)
- func (m *MockCollectorInterface) SetAllowedDomains(arg0 []string)
- func (m *MockCollectorInterface) SetIgnoreRobotsTxt(arg0 bool)
- func (m *MockCollectorInterface) Visit(URL string) error
- func (m *MockCollectorInterface) Wait()
- type MockCollectorInterfaceMockRecorder
- func (mr *MockCollectorInterfaceMockRecorder) AllowURLRevisit() *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) GetUnderlyingCollector() *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) IgnoreRobotsTxt() *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) Limit(limitRule any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) OnError(arg0 any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) OnHTML(selector, cb any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) OnScraped(callback any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) SetAllowURLRevisit(allow any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) SetAllowedDomains(arg0 any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) SetIgnoreRobotsTxt(arg0 any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) Visit(URL any) *gomock.Call
- func (mr *MockCollectorInterfaceMockRecorder) Wait() *gomock.Call
- type MockLogger
- func (m *MockLogger) AllEntries() []observer.LoggedEntry
- func (m *MockLogger) Debug(msg string)
- func (m *MockLogger) Error(msg string)
- func (m *MockLogger) Event(e *debug.Event)
- func (m *MockLogger) Fatal(msg string)
- func (m *MockLogger) Info(msg string)
- func (m *MockLogger) Init() error
- func (m *MockLogger) SetLevel(level zapcore.Level)
- func (m *MockLogger) Warn(msg string)
- type MockMongoDBWrapper
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockClient ¶
func NewMockClient() prowlredis.ClientInterface
Types ¶
type CrawlManagerInterface ¶
CrawlManagerInterface is an autogenerated mock type for the CrawlManagerInterface type
func NewCrawlManagerInterface ¶
func NewCrawlManagerInterface(t interface { mock.TestingT Cleanup(func()) }) *CrawlManagerInterface
NewCrawlManagerInterface creates a new instance of CrawlManagerInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*CrawlManagerInterface) Collector ¶
func (_m *CrawlManagerInterface) Collector(_a0 *colly.Collector) *crawler.CollectorWrapper
Collector provides a mock function with given fields: _a0
func (*CrawlManagerInterface) Crawl ¶
func (_m *CrawlManagerInterface) Crawl(ctx context.Context, url string, searchTerms string, crawlSiteID string, maxDepth int, debug bool) ([]crawler.PageData, error)
Crawl provides a mock function with given fields: ctx, url, searchTerms, crawlSiteID, maxDepth, debug
func (*CrawlManagerInterface) CrawlURL ¶
func (_m *CrawlManagerInterface) CrawlURL(url string) error
CrawlURL provides a mock function with given fields: url
func (*CrawlManagerInterface) HandleVisitError ¶
func (_m *CrawlManagerInterface) HandleVisitError(url string, err error) error
HandleVisitError provides a mock function with given fields: url, err
func (*CrawlManagerInterface) Logger ¶
func (_m *CrawlManagerInterface) Logger() logger.Logger
Logger provides a mock function with given fields:
func (*CrawlManagerInterface) ProcessMatchingLink ¶
func (_m *CrawlManagerInterface) ProcessMatchingLink(options *crawler.CrawlOptions, currentURL string, pageData crawler.PageData, matchingTerms []string)
ProcessMatchingLink provides a mock function with given fields: options, currentURL, pageData, matchingTerms
func (*CrawlManagerInterface) SetupCrawlingLogic ¶
func (_m *CrawlManagerInterface) SetupCrawlingLogic(_a0 *crawler.CrawlOptions) error
SetupCrawlingLogic provides a mock function with given fields: _a0
func (*CrawlManagerInterface) SetupErrorEventHandler ¶
func (_m *CrawlManagerInterface) SetupErrorEventHandler(collector *colly.Collector)
SetupErrorEventHandler provides a mock function with given fields: collector
func (*CrawlManagerInterface) SetupHTMLParsingHandler ¶
func (_m *CrawlManagerInterface) SetupHTMLParsingHandler(handler func(*colly.HTMLElement)) error
SetupHTMLParsingHandler provides a mock function with given fields: handler
func (*CrawlManagerInterface) UpdateStats ¶
func (_m *CrawlManagerInterface) UpdateStats(options *crawler.CrawlOptions, matchingTerms []string)
UpdateStats provides a mock function with given fields: options, matchingTerms
type MockClient ¶
func (*MockClient) Options ¶
func (m *MockClient) Options() *prowlredis.Options
func (*MockClient) SAdd ¶
func (m *MockClient) SAdd(_ context.Context, key string, members ...interface{}) error
type MockCollectorInterface ¶
type MockCollectorInterface struct {
// contains filtered or unexported fields
}
MockCollectorInterface is a mock of CollectorInterface interface.
func NewMockCollectorInterface ¶
func NewMockCollectorInterface(ctrl *gomock.Controller) *MockCollectorInterface
NewMockCollectorInterface creates a new mock instance.
func (*MockCollectorInterface) AllowURLRevisit ¶
func (m *MockCollectorInterface) AllowURLRevisit() bool
AllowURLRevisit mocks base method.
func (*MockCollectorInterface) EXPECT ¶
func (m *MockCollectorInterface) EXPECT() *MockCollectorInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCollectorInterface) GetUnderlyingCollector ¶
func (m *MockCollectorInterface) GetUnderlyingCollector() *colly.Collector
GetUnderlyingCollector mocks base method.
func (*MockCollectorInterface) IgnoreRobotsTxt ¶
func (m *MockCollectorInterface) IgnoreRobotsTxt() bool
IgnoreRobotsTxt mocks base method.
func (*MockCollectorInterface) Limit ¶
func (m *MockCollectorInterface) Limit(limitRule colly.LimitRule) error
Limit mocks base method.
func (*MockCollectorInterface) OnError ¶
func (m *MockCollectorInterface) OnError(arg0 func(*colly.Response, error))
OnError mocks base method.
func (*MockCollectorInterface) OnHTML ¶
func (m *MockCollectorInterface) OnHTML(selector string, cb func(*colly.HTMLElement))
OnHTML mocks base method.
func (*MockCollectorInterface) OnScraped ¶
func (m *MockCollectorInterface) OnScraped(callback func(*colly.Response))
OnScraped mocks base method.
func (*MockCollectorInterface) SetAllowURLRevisit ¶
func (m *MockCollectorInterface) SetAllowURLRevisit(allow bool)
SetAllowURLRevisit mocks base method.
func (*MockCollectorInterface) SetAllowedDomains ¶
func (m *MockCollectorInterface) SetAllowedDomains(arg0 []string)
SetAllowedDomains mocks base method.
func (*MockCollectorInterface) SetIgnoreRobotsTxt ¶
func (m *MockCollectorInterface) SetIgnoreRobotsTxt(arg0 bool)
SetIgnoreRobotsTxt mocks base method.
func (*MockCollectorInterface) Visit ¶
func (m *MockCollectorInterface) Visit(URL string) error
Visit mocks base method.
func (*MockCollectorInterface) Wait ¶
func (m *MockCollectorInterface) Wait()
Wait mocks base method.
type MockCollectorInterfaceMockRecorder ¶
type MockCollectorInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockCollectorInterfaceMockRecorder is the mock recorder for MockCollectorInterface.
func (*MockCollectorInterfaceMockRecorder) AllowURLRevisit ¶
func (mr *MockCollectorInterfaceMockRecorder) AllowURLRevisit() *gomock.Call
AllowURLRevisit indicates an expected call of AllowURLRevisit.
func (*MockCollectorInterfaceMockRecorder) GetUnderlyingCollector ¶
func (mr *MockCollectorInterfaceMockRecorder) GetUnderlyingCollector() *gomock.Call
GetUnderlyingCollector indicates an expected call of GetUnderlyingCollector.
func (*MockCollectorInterfaceMockRecorder) IgnoreRobotsTxt ¶
func (mr *MockCollectorInterfaceMockRecorder) IgnoreRobotsTxt() *gomock.Call
IgnoreRobotsTxt indicates an expected call of IgnoreRobotsTxt.
func (*MockCollectorInterfaceMockRecorder) Limit ¶
func (mr *MockCollectorInterfaceMockRecorder) Limit(limitRule any) *gomock.Call
Limit indicates an expected call of Limit.
func (*MockCollectorInterfaceMockRecorder) OnError ¶
func (mr *MockCollectorInterfaceMockRecorder) OnError(arg0 any) *gomock.Call
OnError indicates an expected call of OnError.
func (*MockCollectorInterfaceMockRecorder) OnHTML ¶
func (mr *MockCollectorInterfaceMockRecorder) OnHTML(selector, cb any) *gomock.Call
OnHTML indicates an expected call of OnHTML.
func (*MockCollectorInterfaceMockRecorder) OnScraped ¶
func (mr *MockCollectorInterfaceMockRecorder) OnScraped(callback any) *gomock.Call
OnScraped indicates an expected call of OnScraped.
func (*MockCollectorInterfaceMockRecorder) SetAllowURLRevisit ¶
func (mr *MockCollectorInterfaceMockRecorder) SetAllowURLRevisit(allow any) *gomock.Call
SetAllowURLRevisit indicates an expected call of SetAllowURLRevisit.
func (*MockCollectorInterfaceMockRecorder) SetAllowedDomains ¶
func (mr *MockCollectorInterfaceMockRecorder) SetAllowedDomains(arg0 any) *gomock.Call
SetAllowedDomains indicates an expected call of SetAllowedDomains.
func (*MockCollectorInterfaceMockRecorder) SetIgnoreRobotsTxt ¶
func (mr *MockCollectorInterfaceMockRecorder) SetIgnoreRobotsTxt(arg0 any) *gomock.Call
SetIgnoreRobotsTxt indicates an expected call of SetIgnoreRobotsTxt.
func (*MockCollectorInterfaceMockRecorder) Visit ¶
func (mr *MockCollectorInterfaceMockRecorder) Visit(URL any) *gomock.Call
Visit indicates an expected call of Visit.
func (*MockCollectorInterfaceMockRecorder) Wait ¶
func (mr *MockCollectorInterfaceMockRecorder) Wait() *gomock.Call
Wait indicates an expected call of Wait.
type MockLogger ¶
func NewMockLogger ¶
func NewMockLogger() *MockLogger
func (*MockLogger) AllEntries ¶
func (m *MockLogger) AllEntries() []observer.LoggedEntry
AllEntries returns all logged entries captured by the observer.
func (*MockLogger) Debug ¶
func (m *MockLogger) Debug(msg string)
func (*MockLogger) Error ¶
func (m *MockLogger) Error(msg string)
func (*MockLogger) Event ¶
func (m *MockLogger) Event(e *debug.Event)
Event implements logger.Logger.
func (*MockLogger) Fatal ¶
func (m *MockLogger) Fatal(msg string)
func (*MockLogger) Info ¶
func (m *MockLogger) Info(msg string)
func (*MockLogger) SetLevel ¶
func (m *MockLogger) SetLevel(level zapcore.Level)
func (*MockLogger) Warn ¶
func (m *MockLogger) Warn(msg string)
type MockMongoDBWrapper ¶
type MockMongoDBWrapper struct{}
func NewMockMongoDBWrapper ¶
func NewMockMongoDBWrapper() *MockMongoDBWrapper