コード例 #1
0
ファイル: updater.go プロジェクト: zhangxiaoyang/goDataAccess
func (this *Updater) isAgentServerOK() bool {
	_, err := common.NewProxy().GetOneProxy("http://example.com")
	if err != nil {
		return false
	}
	return true
}
コード例 #2
0
func (this *ProxyPlugin) Do(pluginType PluginType, args ...interface{}) {
	if pluginType == BeforeDownloaderType {
		req := args[0].(*common.Request)
		var err error
		req.ProxyUrl, err = common.NewProxy().GetOneProxy(req.Url)
		if err != nil {
			req.Error = err
		}
	}
}