1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-07 06:56:47 +00:00

feature(manager): skeleton for worker-manager communication

这个提交包含在:
bigeagle
2016-04-23 21:54:00 +08:00
父节点 681388ffdd
当前提交 afee5b2a81
共有 3 个文件被更改,包括 74 次插入3 次删除

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
}