add test suites, scrape config

This commit is contained in:
lapwat
2021-12-22 22:28:19 +01:00
parent 0009435769
commit ff3d09c727
9 changed files with 421 additions and 45 deletions

View File

@@ -1,13 +1,20 @@
package book
type chapter struct {
name string
author string
content string
body string
name string
author string
content string
subChapters []chapter
config *ScrapeConfig
}
func NewChapter(name, author, content string) chapter {
return chapter{name, author, content}
func NewChapter(body, name, author, content string, subChapters []chapter, config *ScrapeConfig) chapter {
return chapter{body, name, author, content, subChapters, config}
}
func (c chapter) Body() string {
return c.body
}
func (c chapter) Name() string {
@@ -21,3 +28,7 @@ func (c chapter) Author() string {
func (c chapter) Content() string {
return c.content
}
func (c chapter) SubChapters() []chapter {
return c.subChapters
}