mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-21 04:42:46 +00:00
24 lines
423 B
Go
24 lines
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
|
|
}
|