Documentation
¶
Index ¶
- Variables
- type Fether
- type Recv
- func (c *Recv) Parent() *Recv
- func (c *Recv) ParentItem() interface{}
- func (c *Recv) ParentResult() interface{}
- func (c *Recv) Parents(lasts ...int) *Recv
- func (c *Recv) ParentsItem(lasts ...int) interface{}
- func (c *Recv) ParentsResult(lasts ...int) interface{}
- func (c *Recv) ResultByIndex(index int) interface{}
- func (c *Recv) String() string
- func (_ *Recv) UniqueID() (string, error)
- type Result
- type Rule
- func (c *Rule) Collect(parentID uint64, parentURL string, recv *Recv, fetch Fether, extra []*Rule, ...) ([]Result, error)
- func (c *Rule) CollectOne(recv *Recv, urlIndex int, parentID uint64, parentURL string, pageURL string, ...) (collection interface{}, result []Result, ignore bool, err error)
- func (c *Rule) IsExited() bool
- func (c *Rule) ParseTmplContent(tmplContent string, result *Recv) (string, error)
- type Rules
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrForcedExit = errors.New(`Forced exit`)
View Source
var RegexpTitle = regexp.MustCompile(`(?i)<title[\s]*>([^<]+)</title[\s]*>`)
Functions ¶
This section is empty.
Types ¶
type Recv ¶
type Recv struct {
Index int
IsEmpty bool //是否为空结果
LevelIndex int //层级索引
URLIndex int //网址列表索引
Result interface{} //采集结果数据
//rule *Rule //页面规则
Title string //页面标题
URL string //网址
// contains filtered or unexported fields
}
func (*Recv) ParentItem ¶ added in v1.4.2
func (c *Recv) ParentItem() interface{}
func (*Recv) ParentResult ¶
func (c *Recv) ParentResult() interface{}
func (*Recv) ParentsItem ¶ added in v1.4.2
func (*Recv) ParentsResult ¶
func (*Recv) ResultByIndex ¶ added in v1.4.2
type Result ¶
type Result struct {
Title string
URL string
Result interface{}
Type string //map/slice
StartTime time.Time
EndTime time.Time
Elapsed time.Duration
}
func (*Result) ElapsedString ¶
type Rule ¶
type Rule struct {
*dbschema.NgingCollectorPage // 页面配置
RuleList []*dbschema.NgingCollectorRule // 采集规则列表
// contains filtered or unexported fields
}
Rule 页面规则
func (*Rule) CollectOne ¶ added in v1.4.2
Click to show internal directories.
Click to hide internal directories.