Compare commits

..

No commits in common. "v0.2.1" and "master" have entirely different histories.

2 changed files with 15 additions and 23 deletions

View File

@ -1,23 +0,0 @@
package cwclient
import "encoding/json"
// Callback 发送代理连接获取内容后的回调函数
type Callback struct {
label string
hash string
Do func(cxt *CallbackContext)
}
// CallbackContext Callback上下文
type CallbackContext struct {
TaskID string
Content string
Error error
Carry interface{} // 传递的参数.
}
// ContentJSON 返回 json反序列化的对象
func (cxt *CallbackContext) ContentJSON(obj interface{}) error {
return json.Unmarshal([]byte(cxt.Content), obj)
}

View File

@ -21,6 +21,21 @@ func init() {
log.SetFlags(log.Llongfile | log.LstdFlags) log.SetFlags(log.Llongfile | log.LstdFlags)
} }
// CallbackContext Callback上下文
type CallbackContext struct {
TaskID string
Content string
Error error
Carry interface{} // 传递的参数.
}
// Callback 发送代理连接获取内容后的回调函数
type Callback struct {
label string
hash string
Do func(cxt *CallbackContext)
}
// Client 客户端 // Client 客户端
type Client struct { type Client struct {
chromeProxyAddr string chromeProxyAddr string