镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-07 06:56:47 +00:00
feature(manager): skeleton for worker-manager communication
这个提交包含在:
23
manager/db.go
普通文件
23
manager/db.go
普通文件
@@ -0,0 +1,23 @@
|
||||
package manager
|
||||
|
||||
import "github.com/boltdb/bolt"
|
||||
|
||||
type dbAdapter interface {
|
||||
GetWorker(workerID string)
|
||||
UpdateMirrorStatus(workerID, mirrorID string, status mirrorStatus)
|
||||
GetMirrorStatus(workerID, mirrorID string)
|
||||
GetMirrorStatusList(workerID string)
|
||||
Close()
|
||||
}
|
||||
|
||||
type boltAdapter struct {
|
||||
db *bolt.DB
|
||||
dbFile string
|
||||
}
|
||||
|
||||
func (b *boltAdapter) Close() error {
|
||||
if b.db != nil {
|
||||
return b.db.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户