lib/model: Clarify master terminology (fixes #2679)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3793
This commit is contained in:
Heiko Zuerker
2016-12-16 22:23:35 +00:00
committed by Audrius Butkevicius
parent 542b76f687
commit 398c356f22
13 changed files with 72 additions and 70 deletions

View File

@@ -9,15 +9,15 @@ package config
type FolderType int
const (
FolderTypeReadWrite FolderType = iota // default is readwrite
FolderTypeReadOnly
FolderTypeSendReceive FolderType = iota // default is sendreceive
FolderTypeSendOnly
)
func (t FolderType) String() string {
switch t {
case FolderTypeReadWrite:
case FolderTypeSendReceive:
return "readwrite"
case FolderTypeReadOnly:
case FolderTypeSendOnly:
return "readonly"
default:
return "unknown"
@@ -30,12 +30,12 @@ func (t FolderType) MarshalText() ([]byte, error) {
func (t *FolderType) UnmarshalText(bs []byte) error {
switch string(bs) {
case "readwrite":
*t = FolderTypeReadWrite
case "readonly":
*t = FolderTypeReadOnly
case "readwrite", "sendreceive":
*t = FolderTypeSendReceive
case "readonly", "sendonly":
*t = FolderTypeSendOnly
default:
*t = FolderTypeReadWrite
*t = FolderTypeSendReceive
}
return nil
}