File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,6 @@ import (
99 oct "github.com/rapidclock/web-octopus/octopus"
1010)
1111
12- // OutputAdapter is the interface for the Adapter that is used to handle
13- // output from the Octopus Crawler.
14- // The contract stipulates that the crawler provides the channel
15- // to listen for a quit command.
16- // The crawler pumps its output onto the returned channel of the Consume method.
17- // Implementers of the interface should listen on this channel for output from
18- // the crawler.
19- type OutputAdapter interface {
20- Consume (quitCh <- chan bool ) chan <- oct.CrawlOutput
21- }
22-
2312// StdOpAdapter is an output adapter that just prints the output onto the screen.
2413type StdOpAdapter struct {}
2514
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ package octopus
33import (
44 "io"
55 "time"
6-
7- "github.com/rapidclock/web-octopus/adapter"
86)
97
108// Node is used to represent each crawled link and its associated depth of crawl.
@@ -41,10 +39,21 @@ type CrawlOptions struct {
4139 CrawlRate time.Duration
4240 RespectRobots bool
4341 IncludeBody bool
44- OpAdapter adapter. OutputAdapter
42+ OpAdapter OutputAdapter
4543}
4644
4745type CrawlOutput struct {
4846 Node
4947 Body io.ReadCloser
5048}
49+
50+ // OutputAdapter is the interface for the Adapter that is used to handle
51+ // output from the Octopus Crawler.
52+ // The contract stipulates that the crawler provides the channel
53+ // to listen for a quit command.
54+ // The crawler pumps its output onto the returned channel of the Consume method.
55+ // Implementers of the interface should listen on this channel for output from
56+ // the crawler.
57+ type OutputAdapter interface {
58+ Consume (quitCh <- chan bool ) chan <- CrawlOutput
59+ }
You can’t perform that action at this time.
0 commit comments