Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrontierMock ¶
type FrontierMock struct { frontierV1.UnimplementedFrontierServer Server *grpc.Server ClientConn *serviceconnections.Connections // contains filtered or unexported fields }
*
- Server mocks
func NewFrontierMock ¶
func NewFrontierMock(requestPageFunc RequestPageFunc, errorFunc ErrorFunc, metricsFunc MetricsFunc, outlinkFunc OutlinkFunc) *FrontierMock
func (*FrontierMock) BufDialerOption ¶
func (m *FrontierMock) BufDialerOption() grpc.DialOption
func (*FrontierMock) Close ¶
func (m *FrontierMock) Close()
func (*FrontierMock) CrawlSeed ¶
func (m *FrontierMock) CrawlSeed(context.Context, *frontierV1.CrawlSeedRequest) (*frontierV1.CrawlExecutionId, error)
Implements Frontier
func (*FrontierMock) GetNextPage ¶
func (m *FrontierMock) GetNextPage(server frontierV1.Frontier_GetNextPageServer) error
Implements Frontier
type MetricsFunc ¶
type MetricsFunc func(*frontierV1.PageHarvest_Metrics)
type OutlinkFunc ¶
type OutlinkFunc func(*frontierV1.QueuedUri)
type RequestPageFunc ¶
type RequestPageFunc func() (qUri *frontierV1.QueuedUri, crawlConfig *configV1.ConfigObject)
type RobotsEvaluatorMock ¶ added in v0.1.3
type RobotsEvaluatorMock struct { // optional function to call at connect time ConnectFunc func() error // optional function to call when RobotsEvaluator is closing CloseFunc func() error // optional function to call when IsAllowed is called on RobotsEvaluator. IsAllowed will always return true if this // is not set IsAllowedFunc func(*robotsevaluatorV1.IsAllowedRequest) bool }
RobotsEvaluatorMock is a helper structure for mocking robotsevaluator.RobotsEvaluator
func (*RobotsEvaluatorMock) Close ¶ added in v0.1.3
func (r *RobotsEvaluatorMock) Close() error
func (*RobotsEvaluatorMock) Connect ¶ added in v0.1.3
func (r *RobotsEvaluatorMock) Connect() error
func (*RobotsEvaluatorMock) IsAllowed ¶ added in v0.1.3
func (r *RobotsEvaluatorMock) IsAllowed(_ context.Context, request *robotsevaluatorV1.IsAllowedRequest) bool
type ScreenshotWriterMock ¶ added in v0.1.3
type ScreenshotWriterMock struct { // optional function to call at connect time ConnectFunc func() error // optional function to call when RobotsEvaluator is closing CloseFunc func() error // optional function to call when Write is called on ScreenshotWriter. Write will always return nil if this // is not set WriteFunc func(data []byte, metadata screenshotwriter.Metadata) error }
ScreenshotWriterMock is a helper structure for mocking screenshotwriter.ScreenshotWriter
func (*ScreenshotWriterMock) Close ¶ added in v0.1.3
func (s *ScreenshotWriterMock) Close() error
func (*ScreenshotWriterMock) Connect ¶ added in v0.1.3
func (s *ScreenshotWriterMock) Connect() error
func (*ScreenshotWriterMock) Write ¶ added in v0.1.3
func (s *ScreenshotWriterMock) Write(_ context.Context, data []byte, metadata screenshotwriter.Metadata) error
Click to show internal directories.
Click to hide internal directories.