crawler

package
v0.0.0-...-eb64f0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrawlerPath   = "crawler.db"
	CrawlerBucket = "crawler"
)

Variables

This section is empty.

Functions

func StartCrawler

func StartCrawler(c Crawler) error

StartCrawler executes the crawler

Types

type Crawler

type Crawler interface {
	Init() error
	Start() error
}

Crawler interface

type Data

type Data interface {
	String() string
	File() (string, string, string)
	IsFile() bool
}

Data -

type DefaultData

type DefaultData struct {
	// Source -
	Source string
	// Date -
	Date string
	// Title -
	Title string
	// URL -
	URL string
	// Text -
	Text string
	// FileType -
	FileType string
}

DefaultData -

func (*DefaultData) File

func (data *DefaultData) File() (title, filetype, content string)

File return title, filetype and content if data is a file type.

func (*DefaultData) IsFile

func (data *DefaultData) IsFile() bool

IsFile return true if field FileType is not "".

func (*DefaultData) String

func (data *DefaultData) String() string

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL