lib/config: Change folder type attribute to a FolderType type
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3032
This commit is contained in:
committed by
Audrius Butkevicius
parent
eabd2fc936
commit
09832abe50
@@ -104,7 +104,7 @@ type folderFactory func(*Model, config.FolderConfiguration, versioner.Versioner)
|
||||
|
||||
var (
|
||||
symlinkWarning = stdsync.Once{}
|
||||
folderFactories = make(map[string]folderFactory, 0)
|
||||
folderFactories = make(map[config.FolderType]folderFactory, 0)
|
||||
)
|
||||
|
||||
// NewModel creates and starts a new model. The model starts in read-only mode,
|
||||
@@ -176,7 +176,7 @@ func (m *Model) StartFolder(folder string) {
|
||||
|
||||
folderFactory, ok := folderFactories[cfg.Type]
|
||||
if !ok {
|
||||
panic("unknown folder type " + cfg.Type)
|
||||
panic(fmt.Sprintf("unknown folder type 0x%x", cfg.Type))
|
||||
}
|
||||
|
||||
var ver versioner.Versioner
|
||||
|
||||
@@ -34,7 +34,7 @@ func init() {
|
||||
device1, _ = protocol.DeviceIDFromString("AIR6LPZ-7K4PTTV-UXQSMUU-CPQ5YWH-OEDFIIQ-JUG777G-2YQXXR5-YD6AWQR")
|
||||
device2, _ = protocol.DeviceIDFromString("GYRZZQB-IRNPV4Z-T7TC52W-EQYJ3TT-FDQW6MW-DFLMU42-SSSU6EM-FBK2VAY")
|
||||
|
||||
defaultFolderConfig = config.NewFolderConfiguration("default", "testdata", config.FolderTypeReadWrite)
|
||||
defaultFolderConfig = config.NewFolderConfiguration("default", "testdata")
|
||||
defaultFolderConfig.Devices = []config.FolderDeviceConfiguration{{DeviceID: device1}}
|
||||
_defaultConfig := config.Configuration{
|
||||
Folders: []config.FolderConfiguration{defaultFolderConfig},
|
||||
|
||||
Reference in New Issue
Block a user