Documentation ¶
Index ¶
- func ApplyFilters(filter Filter, value string) string
- func ExtractLinks(data []LinkData) []string
- type DetailSchema
- type Field
- func (field Field) CompileFlat(e *colly.HTMLElement) (interface{}, string, error)
- func (field Field) GetRegex() []Regex
- func (field Field) GetRemove() []string
- func (field Field) GetReplace() map[string]string
- func (field Field) IsFlat() bool
- func (field Field) IsFloat() bool
- func (field Field) IsInt() bool
- func (field Field) IsList() bool
- func (field Field) IsString() bool
- func (field Field) SafeCompile(e *colly.HTMLElement) interface{}
- func (field Field) SafeCompileDeep(e *colly.HTMLElement) interface{}
- func (field Field) SafeCompileFlat(e *colly.HTMLElement) interface{}
- type FieldContains
- type Filter
- type LinkData
- type LinkField
- type ListItem
- type ListSchema
- type PageSchema
- type Pagination
- type PaginationLink
- type ParsedLinks
- type Regex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFilters ¶
func ExtractLinks ¶
Types ¶
type DetailSchema ¶
type DetailSchema struct {
Fields []Field
}
type Field ¶
type Field struct { Name string Selector string Type *string Attr *string Contains *FieldContains Replace map[string]string Remove []string Regex []Regex Item *ListItem }
func (Field) CompileFlat ¶
func (Field) GetReplace ¶
func (Field) SafeCompile ¶
func (field Field) SafeCompile(e *colly.HTMLElement) interface{}
func (Field) SafeCompileDeep ¶
func (field Field) SafeCompileDeep(e *colly.HTMLElement) interface{}
func (Field) SafeCompileFlat ¶
func (field Field) SafeCompileFlat(e *colly.HTMLElement) interface{}
type FieldContains ¶
type LinkField ¶
type LinkField struct { Selector string `yaml:"selector"` Attr string Regex []Regex Remove []string Replace map[string]string }
func (LinkField) GetReplace ¶
func (*LinkField) SafeCompile ¶
type ListItem ¶
func (*ListItem) SafeCompile ¶
func (li *ListItem) SafeCompile(e *colly.HTMLElement) interface{}
type ListSchema ¶
type ListSchema struct { ContainerSelector string `yaml:"container_selector"` ItemSelector string `yaml:"item_selector"` Prefix string `yaml:"prefix"` IncludePrefix bool `yaml:"include_prefix"` Pagination Pagination Link struct { A LinkField Data []Field } }
func (*ListSchema) SafeCompile ¶
func (ls *ListSchema) SafeCompile(e *colly.HTMLElement) []LinkData
type PageSchema ¶
type PageSchema struct { ID string Version string Cloudflare bool Detail DetailSchema List ListSchema }
func ReadSchema ¶
func ReadSchema(filename string) (*PageSchema, error)
type Pagination ¶
type Pagination struct { Next PaginationLink Previous PaginationLink }
type PaginationLink ¶
func (*PaginationLink) GetValue ¶
func (pl *PaginationLink) GetValue(e *colly.HTMLElement) string
type ParsedLinks ¶
func ParseLinkData ¶
func ParseLinkData(data []LinkData) ParsedLinks
func (ParsedLinks) Extend ¶
func (pl ParsedLinks) Extend(links ParsedLinks)
Click to show internal directories.
Click to hide internal directories.