command

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputCmd = &cobra.Command{
	Use:   "output",
	Short: "导出已爬取的数据",
	Long:  "导出已爬取的数据",
	Run: func(cmd *cobra.Command, args []string) {
		if err := taskToCSV(e.Store.All(), filename); err != nil {
			store.Log.Panic("taskToCSV", err)
		}
		os.Exit(0)
	},
}

Functions

func InitEngine

func InitEngine(s *store.Store, logPath string, threadNum ...int) error

初始化引擎

@Params
s			存储
logPath 	日志路径
threadNum	线程数(默认1)

func NewStore

func NewStore() (*store.Store, error)

创建存储

func RegisterAdapters

func RegisterAdapters(adapters []engine.Adapter)

注册适配器

@Params
adapters 适配器

func Run

func Run(ts ...models.Task)

执行

命令:(详情请运行 加参数 --help)
run		执行程序
output	导出文件

@Params
ts 初始任务

Types

This section is empty.

Jump to

Keyboard shortcuts

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