mocks

package
v0.0.0-...-a1fbe56 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mocks is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockClient

func NewMockClient() prowlredis.ClientInterface

Types

type CrawlManagerInterface

type CrawlManagerInterface struct {
	mock.Mock
}

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

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 (_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

type MockClient struct {
	WasDelCalled bool
	DelErr       error
	// contains filtered or unexported fields
}

func (*MockClient) Del

func (m *MockClient) Del(_ context.Context, keys ...string) error

func (*MockClient) Options

func (m *MockClient) Options() *prowlredis.Options

func (*MockClient) Ping

func (m *MockClient) Ping(_ context.Context) error

func (*MockClient) SAdd

func (m *MockClient) SAdd(_ context.Context, key string, members ...interface{}) error

func (*MockClient) SIsMember

func (m *MockClient) SIsMember(_ context.Context, key string, member interface{}) (bool, error)

func (*MockClient) SMembers

func (m *MockClient) SMembers(_ context.Context, key string) ([]string, 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

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

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

Visit indicates an expected call of Visit.

func (*MockCollectorInterfaceMockRecorder) Wait

Wait indicates an expected call of Wait.

type MockLogger

type MockLogger struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

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) Init

func (m *MockLogger) Init() error

Init implements logger.Logger.

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

func (*MockMongoDBWrapper) Connect

func (m *MockMongoDBWrapper) Connect(_ context.Context) error

type Options

type Options struct {
	Addr     string
	Password string
	DB       int
}

Jump to

Keyboard shortcuts

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