1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-07 15:06:47 +00:00
文件
tunasync/manager/db.go

24 行
423 B
Go

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
}