Skip to content

Commit 442e91d

Browse files
committed
design octopus v1.1 - oct map setup fixed
1 parent eda6b60 commit 442e91d

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

main.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ package main
22

33
import (
44
"fmt"
5-
exp "github.com/rapidclock/web-octopus/experimental"
65
"log"
76
"net/http"
87
"time"
8+
9+
adapter2 "github.com/rapidclock/web-octopus/adapter"
10+
exp "github.com/rapidclock/web-octopus/experimental"
11+
oct "github.com/rapidclock/web-octopus/octopus"
912
)
1013

1114
const (
@@ -16,9 +19,21 @@ const (
1619
)
1720

1821
func main() {
19-
//exp.Test_makeLinksAbsolute()
20-
//runPipeline()
21-
runPipelineWithOptions()
22+
// exp.Test_makeLinksAbsolute()
23+
// runPipeline()
24+
// runPipelineWithOptions()
25+
octopusTest()
26+
}
27+
28+
func octopusTest() {
29+
adapter := &adapter2.StdOpAdapter{}
30+
31+
crawlOpt := oct.GetDefaultCrawlOptions()
32+
crawlOpt.OpAdapter = adapter
33+
34+
octopus := oct.New(crawlOpt)
35+
octopus.SetupSystem()
36+
octopus.BeginCrawling(Url2)
2237
}
2338

2439
func checkPipelineA() {

octopus/core.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
)
77

88
func (o *octopus) setupValidProtocolMap() {
9+
o.isValidProtocol = make(map[string]bool)
910
for _, protocol := range o.ValidProtocols {
1011
o.isValidProtocol[protocol] = true
1112
}

0 commit comments

Comments
 (0)