2
0

db.go 423 B

1234567891011121314151617181920212223
  1. package manager
  2. import "github.com/boltdb/bolt"
  3. type dbAdapter interface {
  4. GetWorker(workerID string)
  5. UpdateMirrorStatus(workerID, mirrorID string, status mirrorStatus)
  6. GetMirrorStatus(workerID, mirrorID string)
  7. GetMirrorStatusList(workerID string)
  8. Close()
  9. }
  10. type boltAdapter struct {
  11. db *bolt.DB
  12. dbFile string
  13. }
  14. func (b *boltAdapter) Close() error {
  15. if b.db != nil {
  16. return b.db.Close()
  17. }
  18. return nil
  19. }