2020-07-07 10:39:24 +00:00
|
|
|
package intimate
|
2020-07-06 08:33:35 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
|
|
|
|
_ "github.com/go-sql-driver/mysql"
|
|
|
|
)
|
|
|
|
|
2020-07-08 07:02:55 +00:00
|
|
|
// OperatorFlag 标志
|
|
|
|
type OperatorFlag int32
|
|
|
|
|
|
|
|
const (
|
2020-07-09 03:38:51 +00:00
|
|
|
// OperatorOK 等待被处理
|
|
|
|
OperatorOK OperatorFlag = 100
|
2020-07-16 08:22:14 +00:00
|
|
|
// OperatorExtractorOK 提取数据完成
|
|
|
|
OperatorExtractorOK OperatorFlag = 200
|
2020-07-08 07:02:55 +00:00
|
|
|
// OperatorWait 等待被处理
|
|
|
|
OperatorWait OperatorFlag = 1000
|
|
|
|
// OperatorError 错误标志
|
|
|
|
OperatorError OperatorFlag = 10000
|
|
|
|
)
|
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
type ISet interface {
|
|
|
|
Set(string, interface{})
|
|
|
|
}
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
type IGet interface {
|
|
|
|
Get(string) interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type IGetSet interface {
|
|
|
|
ISet
|
|
|
|
IGet
|
|
|
|
}
|
|
|
|
|
2020-07-10 04:05:33 +00:00
|
|
|
// SourceStore 储存
|
2020-07-20 10:13:54 +00:00
|
|
|
type StoreSource struct {
|
2020-07-22 12:00:02 +00:00
|
|
|
table string
|
|
|
|
db *sql.DB
|
|
|
|
|
|
|
|
popCount int
|
2020-07-09 03:38:51 +00:00
|
|
|
errorCount int
|
|
|
|
errorLimit int
|
2020-07-06 08:33:35 +00:00
|
|
|
}
|