crawler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrawlerDatabaseMock

type CrawlerDatabaseMock struct {
	mock.Mock
}

CrawlerDatabaseMock is a mock to repository that handle with persistence layer.

func (*CrawlerDatabaseMock) Find

func (c *CrawlerDatabaseMock) Find(ctx context.Context, uri string, depth uint) ([]string, error)

Find is a method to fetch links crawled from database.

func (*CrawlerDatabaseMock) Insert

func (c *CrawlerDatabaseMock) Insert(ctx context.Context, uri string, depth uint, uris []string) error

Insert is a method to insert new page crawled on database.

type CrawlerServiceMock

type CrawlerServiceMock struct {
	mock.Mock
}

CrawlerServiceMock is a mock to abstraction that handle with web crawler.

func (*CrawlerServiceMock) Craw

func (c *CrawlerServiceMock) Craw(ctx context.Context, uri string, depth uint) ([]string, error)

Craw execute the call to craw pages concurrently and will respect depth param.

Jump to

Keyboard shortcuts

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