Documentation ¶
Index ¶
- Variables
- func AcquireProxy(addr string) error
- func CrawlProxy(exitCh chan bool, wg *sync.WaitGroup)
- func GetMySQLHandler() *gorm.DB
- func InsertProxy(proxy *Proxy) error
- func InsertProxyStr(p string) error
- func InvalidProxy(addr string) error
- func Run(exitCh chan bool, wg *sync.WaitGroup)
- func Validate(addr string) bool
- type Crawler
- type Proxy
- type ProxyServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DiggerUrl = "http://www.site-digger.com/html/articles/20110516/proxieslist.html" DiggerPattern = `<td><script>document.write\(decrypt\("(.*)"\)\);</script></td>` ReDigger = regexp.MustCompile(DiggerPattern) DiggerKeyPattern = `var baidu_union_id = "(.+)";` ReDiggerKey = regexp.MustCompile(DiggerKeyPattern) )
View Source
var NameFuncs = make(map[string]func() []string)
Functions ¶
func AcquireProxy ¶
func CrawlProxy ¶
func GetMySQLHandler ¶
func InsertProxy ¶
func InsertProxyStr ¶
func InvalidProxy ¶
Types ¶
type Proxy ¶
type Proxy struct { Id uint64 `json:"id" gorm:"id"` IpPort string `json:"ip_port" gorm:"ip_port"` UpdateTime time.Time `json:"update_time" gorm:"update_time"` LastFailTime time.Time `json:"last_fail_time" gorm:"last_fail_time"` TotalCrawl uint64 `json:"total_crawl" gorm:"total_crawl"` TotalFail uint64 `json:"total_fail" gorm:"total_fail"` }
type ProxyServer ¶
func (*ProxyServer) Get ¶
func (s *ProxyServer) Get() string
func (*ProxyServer) ReadProxy ¶
func (s *ProxyServer) ReadProxy()
func (*ProxyServer) Web ¶
func (s *ProxyServer) Web()
Click to show internal directories.
Click to hide internal directories.