Skip to content

zhangweiii/crawlab-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crawlab-go-sdk

crawlab-go-sdk

示例

package main

import crawlabgo "github.com/zhangweiii/crawlab-go-sdk"

// Item 示例结构体
// bson 是mongo中列别名,主要排重时候用
type Item struct {
	TaskID string `bson:"task_id"` // 必须要有用于爬虫平台识别结果
	Name   string `bson:"name"`
	Age    int    `bson:"age"`
}

func main() {
	for i := 0; i < 1000; i++ {
		crawlabgo.SaveItem(&Item{
			Name: "crawlabgo",
			Age:  i,
		})
	}
}

About

crawlab-go-sdk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages