Exemple #1
0
func NewDeviceStatisticsReference(ldb *db.Instance, device string) *DeviceStatisticsReference {
	prefix := string(db.KeyTypeDeviceStatistic) + device
	return &DeviceStatisticsReference{
		ns:     db.NewNamespacedKV(ldb, prefix),
		device: device,
	}
}
Exemple #2
0
func NewDeviceStatisticsReference(ldb *leveldb.DB, device protocol.DeviceID) *DeviceStatisticsReference {
	prefix := string(db.KeyTypeDeviceStatistic) + device.String()
	return &DeviceStatisticsReference{
		ns:     db.NewNamespacedKV(ldb, prefix),
		device: device,
	}
}
Exemple #3
0
func NewFolderStatisticsReference(ldb *leveldb.DB, folder string) *FolderStatisticsReference {
	prefix := string(db.KeyTypeFolderStatistic) + folder
	return &FolderStatisticsReference{
		ns:     db.NewNamespacedKV(ldb, prefix),
		folder: folder,
	}
}
Exemple #4
0
func setUpSendReceiveFolder(model *Model) sendReceiveFolder {
	return sendReceiveFolder{
		folder: folder{
			stateTracker: newStateTracker("default"),
			model:        model,
		},

		mtimeFS:   fs.NewMtimeFS(db.NewNamespacedKV(model.db, "mtime")),
		dir:       "testdata",
		queue:     newJobQueue(),
		errors:    make(map[string]string),
		errorsMut: sync.NewMutex(),
	}
}