intimate/store.go
2020-09-17 18:55:01 +08:00

45 lines
690 B
Go

package intimate
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
// OperatorFlag 标志
type OperatorFlag int32
const (
// OperatorOK 等待被处理
OperatorOK OperatorFlag = 100
// OperatorExtractorOK 提取数据完成
OperatorExtractorOK OperatorFlag = 200
// OperatorWait 等待被处理
OperatorWait OperatorFlag = 1000
// OperatorError 错误标志
OperatorError OperatorFlag = 10000
)
type ISet interface {
Set(string, interface{})
}
type IGet interface {
Get(string) interface{}
}
type IGetSet interface {
ISet
IGet
}
// SourceStore 储存
type StoreSource struct {
table string
db *sql.DB
popCount int
errorCount int
errorLimit int
}